diff --git a/t3.c b/t3.c index efd8e57..3733a8d 100644 --- a/t3.c +++ b/t3.c @@ -640,7 +640,7 @@ int main(int argc, char *argv[]) { pfds[0].revents & POLLIN, pfds[0].revents & POLLPRI, pfds[0].revents & POLLOUT, pfds[0].revents & POLLERR, pfds[0].revents & POLLHUP, pfds[0].revents & POLLNVAL); - if ((pfds[0].revents & POLLIN) && !(pfds[0].revents & POLLHUP)) { + if (pfds[0].revents & POLLIN) { _debug(2, "detected input on stdout_msg_pipe[0]"); struct payload *msg_payload = malloc(sizeof(struct payload)); if (read(stdout_msg_pipe[0], msg_payload, sizeof(struct payload)) > @@ -659,7 +659,7 @@ int main(int argc, char *argv[]) { num_open_fds--; waitpid(stdout_worker, NULL, WNOHANG); } - if ((pfds[1].revents & POLLIN) && !(pfds[1].revents & POLLHUP)) { + if (pfds[1].revents & POLLIN) { _debug(2, "detected input on stderr_msg_pipe[0]"); struct payload *msg_payload = malloc(sizeof(struct payload)); if (read(stderr_msg_pipe[0], msg_payload, sizeof(struct payload)) > diff --git a/tests/midline-flush.args b/tests/midline-flush.args index 75b62c1..f9cb27a 100644 --- a/tests/midline-flush.args +++ b/tests/midline-flush.args @@ -1 +1 @@ --- tests/midline-flush +-- sh -c 'for i in `seq 1 10`; do tests/midline-flush; done' diff --git a/tests/midline-flush.err b/tests/midline-flush.err index 24ef8b5..a677517 100644 --- a/tests/midline-flush.err +++ b/tests/midline-flush.err @@ -1 +1,10 @@ Hello, stderr! Goodbye, stderr! +Hello, stderr! Goodbye, stderr! +Hello, stderr! Goodbye, stderr! +Hello, stderr! Goodbye, stderr! +Hello, stderr! Goodbye, stderr! +Hello, stderr! Goodbye, stderr! +Hello, stderr! Goodbye, stderr! +Hello, stderr! Goodbye, stderr! +Hello, stderr! Goodbye, stderr! +Hello, stderr! Goodbye, stderr! diff --git a/tests/midline-flush.log b/tests/midline-flush.log index 0f12ff8..5da343b 100644 --- a/tests/midline-flush.log +++ b/tests/midline-flush.log @@ -1,2 +1,20 @@ Hello, stderr! Goodbye, stderr! Hello, stdout! Goodbye, stdout! +Hello, stderr! Goodbye, stderr! +Hello, stdout! Goodbye, stdout! +Hello, stderr! Goodbye, stderr! +Hello, stdout! Goodbye, stdout! +Hello, stderr! Goodbye, stderr! +Hello, stdout! Goodbye, stdout! +Hello, stderr! Goodbye, stderr! +Hello, stdout! Goodbye, stdout! +Hello, stderr! Goodbye, stderr! +Hello, stdout! Goodbye, stdout! +Hello, stderr! Goodbye, stderr! +Hello, stdout! Goodbye, stdout! +Hello, stderr! Goodbye, stderr! +Hello, stdout! Goodbye, stdout! +Hello, stderr! Goodbye, stderr! +Hello, stdout! Goodbye, stdout! +Hello, stderr! Goodbye, stderr! +Hello, stdout! Goodbye, stdout! diff --git a/tests/midline-flush.out b/tests/midline-flush.out index 4bafc1c..1d8bdd2 100644 --- a/tests/midline-flush.out +++ b/tests/midline-flush.out @@ -1 +1,10 @@ Hello, stdout! Goodbye, stdout! +Hello, stdout! Goodbye, stdout! +Hello, stdout! Goodbye, stdout! +Hello, stdout! Goodbye, stdout! +Hello, stdout! Goodbye, stdout! +Hello, stdout! Goodbye, stdout! +Hello, stdout! Goodbye, stdout! +Hello, stdout! Goodbye, stdout! +Hello, stdout! Goodbye, stdout! +Hello, stdout! Goodbye, stdout!