diff options
author | Matt Kraai <kraai@debian.org> | 2000-12-14 07:34:58 +0300 |
---|---|---|
committer | Matt Kraai <kraai@debian.org> | 2000-12-14 07:34:58 +0300 |
commit | 95fa0ea3d421772f29f78e3484ad824ffd5e8b6f (patch) | |
tree | e016bb8c29e0ab2a0c544cbd87cf97c8213922fd | |
parent | 6f6aa9b428f8d9c1988b837a3e473c5248358384 (diff) |
Shutdown sending on the socket when stdin closes.
-rw-r--r-- | nc.c | 2 | ||||
-rw-r--r-- | networking/nc.c | 2 |
2 files changed, 4 insertions, 0 deletions
@@ -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; } diff --git a/networking/nc.c b/networking/nc.c index 805bbd4d8..84c1a815e 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; } |