Shutdown sending on the socket when stdin closes.
authorMatt Kraai <kraai@debian.org>
Thu, 14 Dec 2000 04:34:58 +0000 (04:34 -0000)
committerMatt Kraai <kraai@debian.org>
Thu, 14 Dec 2000 04:34:58 +0000 (04:34 -0000)
nc.c
networking/nc.c

diff --git a/nc.c b/nc.c
index 805bbd4d8050a717c421280dec1fb944a55dcf8b..84c1a815eddcf6aac40d777a0992e6d04c9dda0d 100644 (file)
--- 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;
                                }
 
index 805bbd4d8050a717c421280dec1fb944a55dcf8b..84c1a815eddcf6aac40d777a0992e6d04c9dda0d 100644 (file)
@@ -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;
                                }