--- src/minutils/s6-uevent-spawner.c | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/src/minutils/s6-uevent-spawner.c b/src/minutils/s6-uevent-spawner.c index 40f088e..f7e2456 100644 --- a/src/minutils/s6-uevent-spawner.c +++ b/src/minutils/s6-uevent-spawner.c _at_@ -219,17 +219,24 @@ int main (int argc, char const *const *argv, char const *const *envp) while (cont || pid) { - register int r = iopause_g(x, 1 + (!pid && cont), &deadline) ; - if (r < 0) strerr_diefu1sys(111, "iopause") ; - else if (!r) handle_timeout() ; + register int ready = !pid && cont ; + + if (ready && !buffer_isempty(buffer_0)) + handle_stdin(&sa, linevar, argv, envp) ; else { - if (x[0].revents & IOPAUSE_EXCEPT) - strerr_diefu1x(111, "iopause: trouble with selfpipe") ; - if (x[0].revents & IOPAUSE_READ) - handle_signals() ; - else if (!pid && cont && (x[1].revents & IOPAUSE_READ)) - handle_stdin(&sa, linevar, argv, envp) ; + register int r = iopause_g(x, 1 + ready, &deadline) ; + if (r < 0) strerr_diefu1sys(111, "iopause") ; + else if (!r) handle_timeout() ; + else + { + if (x[0].revents & IOPAUSE_EXCEPT) + strerr_diefu1x(111, "iopause: trouble with selfpipe") ; + if (x[0].revents & IOPAUSE_READ) + handle_signals() ; + else if (ready && (x[1].revents & IOPAUSE_READ)) + handle_stdin(&sa, linevar, argv, envp) ; + } } } if (verbosity >= 2) strerr_warni1x("exiting") ; -- 2.4.3Received on Sun Jun 14 2015 - 12:37:41 UTC
This archive was generated by hypermail 2.3.0 : Sun May 09 2021 - 19:38:49 UTC