So I was reading http://austingroupbugs.net/view.php?id=529 which states on Linux that one shouldn't retry close() after EINTR as the descriptor is already closed in that case and another thread could reuse the descriptor which a retried close() would close erroneously.
That suggests that the following code in spawn-pipe is problematic? Should be remove the retry, and/or do we need to otherwise handle the SIGSTOP case? thanks, Pádraig. /* EINTR handling for close(). These functions can return -1/EINTR even though we don't have any signal handlers set up, namely when we get interrupted via SIGSTOP. */ static int nonintr_close (int fd) { int retval; do retval = close (fd); while (retval < 0 && errno == EINTR); return retval; } #define close nonintr_close