about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--Src/exec.c4
2 files changed, 9 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 862050ee0..87b322119 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2007-12-07  Peter Stephenson  <pws@csr.com>
+
+	* Guillaume Chazarain: 24170: Src/exec.c: block interrupts
+	around fork since it may mess with locks.
+
 2007-12-07  Clint Adams  <clint@zsh.org>
 
 	* 24172 (tweaked): configure.ac: check ncurses.h, ncurses/ncurses.h, and
diff --git a/Src/exec.c b/Src/exec.c
index cf79ea88b..6f16b9e87 100644
--- a/Src/exec.c
+++ b/Src/exec.c
@@ -229,6 +229,7 @@ zfork(struct timeval *tv)
 {
     pid_t pid;
     struct timezone dummy_tz;
+    sigset_t signals;
 
     /*
      * Is anybody willing to explain this test?
@@ -239,7 +240,10 @@ zfork(struct timeval *tv)
     }
     if (tv)
 	gettimeofday(tv, &dummy_tz);
+    sigfillset(&signals);
+    signals = signal_block(signals);
     pid = fork();
+    signal_setmask(signals);
     if (pid == -1) {
 	zerr("fork failed: %e", errno);
 	return -1;