diff options
author | Paul Fox | 2005-07-18 22:23:16 +0000 |
---|---|---|
committer | Paul Fox | 2005-07-18 22:23:16 +0000 |
commit | 7b71d740b9186633b9a4b1d05247376485e2b805 (patch) | |
tree | 453d47ed9248f96afc553b3ed48527ce6d81ca22 /networking/nc.c | |
parent | d13b90b9e8985e5787621f82d7cc5d29a8ae32ea (diff) | |
download | busybox-7b71d740b9186633b9a4b1d05247376485e2b805.zip busybox-7b71d740b9186633b9a4b1d05247376485e2b805.tar.gz |
fix for "0000027: patch: nc will spin if stdin closed"
Diffstat (limited to 'networking/nc.c')
-rw-r--r-- | networking/nc.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/networking/nc.c b/networking/nc.c index 58cd39f..bf155b3 100644 --- a/networking/nc.c +++ b/networking/nc.c @@ -175,8 +175,11 @@ int nc_main(int argc, char **argv) exit(0); ofd = STDOUT_FILENO; } else { - if (nread == 0) - shutdown(sfd, 1); + if (nread <= 0) { + shutdown(sfd, 1 /* send */ ); + close(STDIN_FILENO); + FD_CLR(STDIN_FILENO, &readfds); + } ofd = sfd; } |