summaryrefslogtreecommitdiff
path: root/networking/nc.c
diff options
context:
space:
mode:
authorMatt Kraai2000-12-14 04:34:58 +0000
committerMatt Kraai2000-12-14 04:34:58 +0000
commit95fa0ea3d421772f29f78e3484ad824ffd5e8b6f (patch)
treee016bb8c29e0ab2a0c544cbd87cf97c8213922fd /networking/nc.c
parent6f6aa9b428f8d9c1988b837a3e473c5248358384 (diff)
downloadbusybox-95fa0ea3d421772f29f78e3484ad824ffd5e8b6f.zip
busybox-95fa0ea3d421772f29f78e3484ad824ffd5e8b6f.tar.gz
Shutdown sending on the socket when stdin closes.
Diffstat (limited to 'networking/nc.c')
-rw-r--r--networking/nc.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/networking/nc.c b/networking/nc.c
index 805bbd4..84c1a81 100644
--- a/networking/nc.c
+++ b/networking/nc.c
@@ -111,6 +111,8 @@ int nc_main(int argc, char **argv)
exit(0);
ofd = fileno(stdout);
} else {
+ if (nread == 0)
+ shutdown(sfd, 1);
ofd = sfd;
}