# # # patch "netxx_pipe.cc" # from [aa104b0a76f126b5359001d9a41255e421c19af0] # to [3fa376f09fb6fe19cb49562d8cbe71b79b95eeb3] # # patch "unix/process.cc" # from [f5e86b9953d044ec811c0aac4f099cefd5ee3cbb] # to [09415276d4a9ac2c41def3e186d128e721f9fdd4] # ============================================================ --- netxx_pipe.cc aa104b0a76f126b5359001d9a41255e421c19af0 +++ netxx_pipe.cc 3fa376f09fb6fe19cb49562d8cbe71b79b95eeb3 @@ -336,7 +336,7 @@ Netxx::PipeStream::close (void) writefd = -1; if (child) - waitpid(child,0,0); + while (waitpid(child,0,0) == -1 && errno == EINTR); child = 0; #endif } ============================================================ --- unix/process.cc f5e86b9953d044ec811c0aac4f099cefd5ee3cbb +++ unix/process.cc 09415276d4a9ac2c41def3e186d128e721f9fdd4 @@ -239,10 +239,21 @@ int process_wait(pid_t pid, int *res, in for (r = 0; r == 0 && timeout >= 0; --timeout) { r = waitpid(pid, &status, flags); + if (r == -1) + { + if (errno == EINTR) + { + timeout++; + r = 0; + continue; + } + else + return -1; + } if (r == 0 && timeout > 0) process_sleep(1); } - if (r == 0) + if ((r == 0) || (r == -1)) return -1; if (WIFEXITED(status)) *res = WEXITSTATUS(status);