mirror of
https://github.com/sheumann/hush.git
synced 2024-12-21 23:29:34 +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);
|
exit(0);
|
||||||
ofd = STDOUT_FILENO;
|
ofd = STDOUT_FILENO;
|
||||||
} else {
|
} else {
|
||||||
if (nread == 0)
|
if (nread <= 0) {
|
||||||
shutdown(sfd, 1);
|
shutdown(sfd, 1 /* send */ );
|
||||||
|
close(STDIN_FILENO);
|
||||||
|
FD_CLR(STDIN_FILENO, &readfds);
|
||||||
|
}
|
||||||
ofd = sfd;
|
ofd = sfd;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user