projects
/
oweals
/
busybox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d13b90b
)
fix for "0000027: patch: nc will spin if stdin closed"
author
Paul Fox
<pgf@brightstareng.com>
Mon, 18 Jul 2005 22:23:16 +0000
(22:23 -0000)
committer
Paul Fox
<pgf@brightstareng.com>
Mon, 18 Jul 2005 22:23:16 +0000
(22:23 -0000)
networking/nc.c
patch
|
blob
|
history
diff --git
a/networking/nc.c
b/networking/nc.c
index 58cd39fac259983f286eb00e3d10e793242635ae..bf155b3b13bb3148dd3fc11d94c4dac2cbb1c489 100644
(file)
--- a/
networking/nc.c
+++ b/
networking/nc.c
@@
-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;
}