aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Weck <peter@storyjumper.com>2010-09-17 12:40:36 +0200
committerStefan B├╝hler <stbuehler@web.de>2010-09-17 12:41:52 +0200
commit8c6b1945bd6eabcdeb4df4bf04e5a11675e9780c (patch)
tree9a6aa89acb1ff89b07dc979598fd136929a12b47
parenta38075bf15f8c37e4216611984715d2514ca2702 (diff)
downloadmultiwatch-8c6b1945bd6eabcdeb4df4bf04e5a11675e9780c.tar.gz
multiwatch-8c6b1945bd6eabcdeb4df4bf04e5a11675e9780c.zip
Reset sigmask after fork()
-rw-r--r--multiwatch.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/multiwatch.c b/multiwatch.c
index 887ce98..1b0fed3 100644
--- a/multiwatch.c
+++ b/multiwatch.c
@@ -113,6 +113,17 @@ static void spawn(child* c) {
break;
case 0:
/* child */
+
+ /* Need to reset the signal mask; signal actions don't need to be reset
+ * according to libev documentation:
+ * http://pod.tst.eu/http://cvs.schmorp.de/libev/ev.pod#The_special_problem_of_inheritance_o
+ */
+ {
+ sigset_t set;
+ sigemptyset(&set);
+ sigprocmask(SIG_SETMASK, &set, NULL);
+ }
+
execv(opts.app[0], opts.app);
g_printerr("Exec failed: %s\n", g_strerror(errno));
exit(errno);