Shutdown sending on the socket when stdin closes.
This commit is contained in:
parent
6f6aa9b428
commit
95fa0ea3d4
2
nc.c
2
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;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user