When nc is running as a persistent server, the client's socket is not
closed in the parent process. This causes the client process to hang.
Here is a simple example:
$ ./busybox nc -l -l -p 8000 -e /bin/echo Hello &
[1] 5994
$ nc localhost 8000
Hello
<---- it doesn't return to the shell prompt
Signed-off-by: Tomoya Adachi <[email protected]>
---
networking/nc.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/networking/nc.c b/networking/nc.c
index e4db238..b344978 100644
--- a/networking/nc.c
+++ b/networking/nc.c
@@ -146,6 +146,7 @@ int nc_main(int argc, char **argv)
close(0);
close(1);
close(2);
+ close(cfd);
goto accept_again;
}
/* child (or main thread if no multiple -l) */
--
1.6.3.3
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox