X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=networking%2Fnc.c;h=1a99f91ccf387109b9a29291363f2c396e80f227;hb=08ea11ab0749a7977e6d47cd0fa7b3c9cc10af32;hp=27c58a8c817706b9154c02bb36140f516b4a89b2;hpb=636a1f85e89432601c59cdc3239fc867b4adf051;p=oweals%2Fbusybox.git diff --git a/networking/nc.c b/networking/nc.c index 27c58a8c8..1a99f91cc 100644 --- a/networking/nc.c +++ b/networking/nc.c @@ -17,7 +17,7 @@ * when compared to "standard" nc */ -static void timeout(int signum ATTRIBUTE_UNUSED) +static void timeout(int signum UNUSED_PARAM) { bb_error_msg_and_die("timed out"); } @@ -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);