about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorShea Levy <shea@shealevy.com>2018-03-15T03·45-0400
committerShea Levy <shea@shealevy.com>2018-03-15T03·45-0400
commitd25d9f7cecad24e16b8e831077996e3b50c04468 (patch)
tree8ab9e6dd958064fbfee14c417dbb259df484f21f /src
parente2088febf3d0cb1138491c891b134887636e4220 (diff)
parentd98755b0c291fed59c71957ac8dbe4ee94e58b10 (diff)
Merge branch 'fix/errno-sighandler' of git://github.com/dtzWill/nix
Diffstat (limited to 'src')
-rw-r--r--src/nix-daemon/nix-daemon.cc3
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;
 }