APUE Learning Example Source Code
Guo Wenxue
2018-12-07 9e2354ec432f40e212e8d9ac54f1efb8567aef8b
ch1_fileIO/redirect_stdio.c
@@ -14,7 +14,7 @@
    if(fd < 0)
    {
        printf("Open file failure: %s\n", strerror(errno));
        return ;
        return 1;
    } 
    
    dup2(fd, STDIN_FILENO);
@@ -24,5 +24,7 @@
    printf("fd=%d\n", fd); 
    
    close(fd);
    return 0;
}