diff options
author | Rob Landley <rob@landley.net> | 2021-01-26 18:50:50 -0600 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2021-01-26 18:50:50 -0600 |
commit | 2b4abd05efcc96061eaa87a6fdbc3f7121fd2c08 (patch) | |
tree | 5b2a372b400388ad7446d71aff9310299060f16f /lib | |
parent | 76d3160cfabe15568f006ad530c105b9ad6fdcdd (diff) | |
download | toybox-2b4abd05efcc96061eaa87a6fdbc3f7121fd2c08.tar.gz |
Fix bug pointed out by asm89 and add test.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/net.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -114,7 +114,10 @@ int pollinate(int in1, int in2, int out1, int out2, int timeout, int shutdown_ti if (pollfds[i].revents & POLLIN) { int len = read(pollfds[i].fd, libbuf, sizeof(libbuf)); if (len<1) pollfds[i].revents = POLLHUP; - else xwrite(i ? out2 : out1, libbuf, len); + else { + xwrite(i ? out2 : out1, libbuf, len); + continue; + } } if (pollfds[i].revents & POLLHUP) { // Close half-connection. This is needed for things like |