mirror of
https://github.com/sheumann/hush.git
synced 2024-12-27 01:32:08 +00:00
fix for "0000027: patch: nc will spin if stdin closed"
This commit is contained in:
parent
d13b90b9e8
commit
7b71d740b9
@ -175,8 +175,11 @@ int nc_main(int argc, char **argv)
|
||||
exit(0);
|
||||
ofd = STDOUT_FILENO;
|
||||
} else {
|
||||
if (nread == 0)
|
||||
shutdown(sfd, 1);
|
||||
if (nread <= 0) {
|
||||
shutdown(sfd, 1 /* send */ );
|
||||
close(STDIN_FILENO);
|
||||
FD_CLR(STDIN_FILENO, &readfds);
|
||||
}
|
||||
ofd = sfd;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user