diff --git a/src/lib/core/popen.c b/src/lib/core/popen.c index 411aad03bae44d7d12f61e9c8d1a7388537cd969..5cd7926d1f939947ab0dd01caded3ba3ac127cc8 100644 --- a/src/lib/core/popen.c +++ b/src/lib/core/popen.c @@ -539,6 +539,13 @@ popen_state_str(unsigned int state) * When POPEN_FLAG_GROUP_SIGNAL is set the function sends * a signal to a process group rather than a process. * + * A signal will not be sent if the child process is already + * dead: otherwise we might kill another process that occupies + * the same PID later. This means that if the child process + * dies before its own childs, the function will not send a + * signal to the process group even when ..._SETSID and + * ..._GROUP_SIGNAL are set. + * * Return 0 at success or -1 at failure (and set a diag). * * Possible errors: @@ -597,6 +604,8 @@ popen_send_signal(struct popen_handle *handle, int signo) * - Remove the handle from a living list. * - Free all occupied memory. * + * @see popen_send_signal() for note about ..._GROUP_SIGNAL. + * * Return 0 at success and -1 at failure (and set a diag). * * Possible errors: diff --git a/src/lib/core/popen.h b/src/lib/core/popen.h index 4cdd95175129054d1b4d38f1ef3950db8ade2000..8cb71e28d9217598136776182484d433b01a15ee 100644 --- a/src/lib/core/popen.h +++ b/src/lib/core/popen.h @@ -99,6 +99,8 @@ enum popen_flag_bits { /* * Send signal to a process group. + * + * @see popen_send_signal() for details. */ POPEN_FLAG_GROUP_SIGNAL_BIT = 16, POPEN_FLAG_GROUP_SIGNAL = (1 << POPEN_FLAG_GROUP_SIGNAL_BIT),