diff options
author | Rob Landley | 2005-08-12 06:06:54 +0000 |
---|---|---|
committer | Rob Landley | 2005-08-12 06:06:54 +0000 |
commit | d5138f44fe2e496498c62a06b7f50381edf952da (patch) | |
tree | b0c7e721ab4924d93491876f5e859389eb22b039 /busybox/networking/nc.c | |
parent | 9344d8aa10ecf99aba3eae97e4fa131360f89729 (diff) | |
download | busybox-d5138f44fe2e496498c62a06b7f50381edf952da.zip busybox-d5138f44fe2e496498c62a06b7f50381edf952da.tar.gz |
Backport 10853, 10860/10870, and 10862.
Diffstat (limited to 'busybox/networking/nc.c')
-rw-r--r-- | busybox/networking/nc.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/busybox/networking/nc.c b/busybox/networking/nc.c index ab8ec0c..6ce85fe 100644 --- a/busybox/networking/nc.c +++ b/busybox/networking/nc.c @@ -161,8 +161,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; } |