APUE Learning Example Source Code
Guo Wenxue
2018-11-15 8d13b7c3d12e05ce4620e43901a554d80d5c7b23
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;
}