askfirst: remove superfluous 'close' calls on stdio file descriptors.
authorYousong Zhou <yszhou4tech@gmail.com>
Tue, 23 Jul 2013 08:28:38 +0000 (16:28 +0800)
committerJohn Crispin <blogic@openwrt.org>
Tue, 23 Jul 2013 10:47:39 +0000 (12:47 +0200)
'dup2' will do it for us if necessary.

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
askfirst.c

index 2f948f8b30a7117ed306015f15754043f8157858..99164862e868e54eff2732e128213723b02658c3 100644 (file)
@@ -31,10 +31,6 @@ static int redirect_output(const char *dev)
        if (fd < 0)
                return -1;
 
-       close(STDIN_FILENO);
-       close(STDOUT_FILENO);
-       close(STDERR_FILENO);
-
        dup2(fd, STDIN_FILENO);
        dup2(fd, STDOUT_FILENO);
        dup2(fd, STDERR_FILENO);