diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2022-04-09 08:28:33 +0900 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2022-04-13 01:00:08 +0900 |
commit | 01e6af737494c9790edcc5521ea8c668565b797f (patch) | |
tree | 74bc93bc01f0a7b7bfaa4d85c590f121a32da2be /src/libsystemd/sd-event | |
parent | 54988a27b9d1487e1690f94b79031ef61edd6651 (diff) | |
download | systemd-01e6af737494c9790edcc5521ea8c668565b797f.tar.gz |
sd-event: do not update signal fd after PID is changed
Otherwise, child event source will not work after the process is forked
and the event source is unref()ed on the child process.
Diffstat (limited to 'src/libsystemd/sd-event')
-rw-r--r-- | src/libsystemd/sd-event/sd-event.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/libsystemd/sd-event/sd-event.c b/src/libsystemd/sd-event/sd-event.c index e7c3fcd37c..ca90890442 100644 --- a/src/libsystemd/sd-event/sd-event.c +++ b/src/libsystemd/sd-event/sd-event.c @@ -706,6 +706,9 @@ static void event_unmask_signal_data(sd_event *e, struct signal_data *d, int sig return; } + if (event_pid_changed(e)) + return; + assert(d->fd >= 0); if (signalfd(d->fd, &d->sigset, SFD_NONBLOCK|SFD_CLOEXEC) < 0) |