about summary refs log tree commit diff
diff options
context:
space:
mode:
-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;