Shutdown sending on the socket when stdin closes.

This commit is contained in:
Matt Kraai 2000-12-14 04:34:58 +00:00
parent 6f6aa9b428
commit 95fa0ea3d4
2 changed files with 4 additions and 0 deletions

2
nc.c
View 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;
}

View 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;
}