1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-15 06:52:43 +01:00

nix-daemon: preserve errno in signal handler (thanks tsan)

(cherry picked from commit d98755b0c2)
This commit is contained in:
Will Dietz 2018-03-14 21:39:01 -05:00 committed by Eelco Dolstra
parent ac5a36c2f3
commit 434cdab511
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE

View file

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