aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2016-03-14 14:08:25 +0100
committerThomas White <taw@physics.org>2016-03-14 14:08:25 +0100
commit37d33b261fcbf7bf2c3f8cd6a81b21303c90baa8 (patch)
tree2614f20cc989b6e03ebd8209f00b8e40f32dfb34 /src
parent6b5a2c15461a7a1bc9d9eca1f3ceed70a61ef8c2 (diff)
Add SA_RESTART to signal handlers
Fixes corrupted output when heavily multi-processing.
Diffstat (limited to 'src')
-rw-r--r--src/im-sandbox.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/im-sandbox.c b/src/im-sandbox.c
index bb8edcac..642c1cd3 100644
--- a/src/im-sandbox.c
+++ b/src/im-sandbox.c
@@ -895,7 +895,7 @@ void create_sandbox(struct index_args *iargs, int n_proc, char *prefix,
}
/* Set up signal handler to take action if any children die */
- sa.sa_flags = SA_SIGINFO | SA_NOCLDSTOP;
+ sa.sa_flags = SA_SIGINFO | SA_NOCLDSTOP | SA_RESTART;
sigemptyset(&sa.sa_mask);
sa.sa_sigaction = sigchld_handler;
r = sigaction(SIGCHLD, &sa, NULL);
@@ -905,7 +905,7 @@ void create_sandbox(struct index_args *iargs, int n_proc, char *prefix,
}
/* Set up signal handler to clean up semaphore on exit */
- sa.sa_flags = SA_SIGINFO | SA_NOCLDSTOP;
+ sa.sa_flags = SA_SIGINFO | SA_NOCLDSTOP | SA_RESTART;
sigemptyset(&sa.sa_mask);
sa.sa_sigaction = sigint_handler;
r = sigaction(SIGINT, &sa, NULL);