diff options
author | Will Dietz <w@wdtz.org> | 2018-03-15T02·39-0500 |
---|---|---|
committer | Will Dietz <w@wdtz.org> | 2018-03-15T02·39-0500 |
commit | d98755b0c291fed59c71957ac8dbe4ee94e58b10 (patch) | |
tree | 17692165be3707f90033d62aa8962c597832fb1b /src/nix-daemon | |
parent | 55aa622fb1ae01a8a939fa32f71e7eed50afbbf9 (diff) |
nix-daemon: preserve errno in signal handler (thanks tsan)
Diffstat (limited to 'src/nix-daemon')
-rw-r--r-- | src/nix-daemon/nix-daemon.cc | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/nix-daemon/nix-daemon.cc b/src/nix-daemon/nix-daemon.cc index 890bffa19aa5..30e2b54552ee 100644 --- a/src/nix-daemon/nix-daemon.cc +++ b/src/nix-daemon/nix-daemon.cc @@ -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; } |