summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--nc.c2
-rw-r--r--networking/nc.c2
2 files changed, 4 insertions, 0 deletions
diff --git a/nc.c b/nc.c
index 805bbd4..84c1a81 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 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;
}