Merge branch 'fix/errno-sighandler' of git://github.com/dtzWill/nix

This commit is contained in:
Shea Levy 2018-03-14 23:45:35 -04:00
commit d25d9f7cec
No known key found for this signature in database
GPG key ID: 5C0BD6957D86FE27

View file

@ -816,8 +816,11 @@ static void processConnection(bool trusted)
static void sigChldHandler(int sigNo) static void sigChldHandler(int sigNo)
{ {
// Ensure we don't modify errno of whatever we've interrupted
auto saved_errno = errno;
/* Reap all dead children. */ /* Reap all dead children. */
while (waitpid(-1, 0, WNOHANG) > 0) ; while (waitpid(-1, 0, WNOHANG) > 0) ;
errno = saved_errno;
} }