APUE Learning Example Source Code
Guo Wenxue
2018-11-16 6c41fb183d2ea71bb8d3a7bf4947f28eacfe97fe
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;
}