about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPaul Ackersviller <packersv@users.sourceforge.net>2007-12-09 02:07:09 +0000
committerPaul Ackersviller <packersv@users.sourceforge.net>2007-12-09 02:07:09 +0000
commitcc418866a1dc7aa2ed8a67c711c2ea609bf06752 (patch)
treef9e08ae812638ec7b436d77a3eb387b812de4f04
parent41192750102fdf250a614ab834b34ba77b668b3d (diff)
downloadzsh-cc418866a1dc7aa2ed8a67c711c2ea609bf06752.tar.gz
zsh-cc418866a1dc7aa2ed8a67c711c2ea609bf06752.tar.xz
zsh-cc418866a1dc7aa2ed8a67c711c2ea609bf06752.zip
Merge of Guillaume Chazarain's 24170: block interrupts around fork
since it may mess with locks.
-rw-r--r--Src/exec.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/Src/exec.c b/Src/exec.c
index 19d68060f..76bd8638a 100644
--- a/Src/exec.c
+++ b/Src/exec.c
@@ -228,7 +228,15 @@ zfork(struct timeval *tv)
     }
     if (tv)
 	gettimeofday(tv, &dummy_tz);
+    /*
+     * Queueing signals is necessary on Linux because fork()
+     * manipulates mutexes, leading to deadlock in memory
+     * allocation.  We don't expect fork() to be particularly
+     * zippy anyway.
+     */
+    queue_signals();
     pid = fork();
+    unqueue_signals();
     if (pid == -1) {
 	zerr("fork failed: %e", NULL, errno);
 	return -1;