diff options
Diffstat (limited to 'networking/nc.c')
-rw-r--r-- | networking/nc.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/networking/nc.c b/networking/nc.c index 27c58a8c8..2fd42d5f6 100644 --- a/networking/nc.c +++ b/networking/nc.c @@ -150,12 +150,9 @@ int nc_main(int argc, char **argv) goto accept_again; } /* child (or main thread if no multiple -l) */ - if (cfd) { - dup2(cfd, 0); - close(cfd); - } - dup2(0, 1); - dup2(0, 2); + xmove_fd(cfd, 0); + xdup2(0, 1); + xdup2(0, 2); USE_NC_EXTRA(BB_EXECVP(execparam[0], execparam);) /* Don't print stuff or it will go over the wire.... */ _exit(127); |