From: Matt Kraai Date: Thu, 14 Dec 2000 04:34:58 +0000 (-0000) Subject: Shutdown sending on the socket when stdin closes. X-Git-Tag: 0_49~129 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=95fa0ea3d421772f29f78e3484ad824ffd5e8b6f;p=oweals%2Fbusybox.git Shutdown sending on the socket when stdin closes. --- diff --git a/nc.c b/nc.c index 805bbd4d8..84c1a815e 100644 --- a/nc.c +++ b/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; } 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; }