projects
/
collectd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
7f71f1b
)
exec plugin: Clear the signal block mask before calling exec(2).
author
Florian Forster
<octo@leeloo.lan.home.verplant.org>
Tue, 15 Sep 2009 13:40:47 +0000
(15:40 +0200)
committer
Florian Forster
<octo@leeloo.lan.home.verplant.org>
Tue, 15 Sep 2009 13:40:47 +0000
(15:40 +0200)
src/exec.c
patch
|
blob
|
history
diff --git
a/src/exec.c
b/src/exec.c
index
1f8a9ac
..
8719201
100644
(file)
--- a/
src/exec.c
+++ b/
src/exec.c
@@
-382,6
+382,15
@@
static void exec_child (program_list_t *pl) /* {{{ */
exit (-1);
} /* void exec_child }}} */
exit (-1);
} /* void exec_child }}} */
+static void reset_signal_mask (void) /* {{{ */
+{
+ sigset_t ss;
+
+ memset (&ss, 0, sizeof (ss));
+ sigemptyset (&ss);
+ sigprocmask (SIG_SETMASK, &ss, /* old mask = */ NULL);
+} /* }}} void reset_signal_mask */
+
/*
* Creates three pipes (one for reading, one for writing and one for errors),
* forks a child, sets up the pipes so that fd_in is connected to STDIN of
/*
* Creates three pipes (one for reading, one for writing and one for errors),
* forks a child, sets up the pipes so that fd_in is connected to STDIN of
@@
-468,6
+477,9
@@
static int fork_child (program_list_t *pl, int *fd_in, int *fd_out, int *fd_err)
close (fd_pipe_err[1]);
}
close (fd_pipe_err[1]);
}
+ /* Unblock all signals */
+ reset_signal_mask ();
+
exec_child (pl);
/* does not return */
}
exec_child (pl);
/* does not return */
}