diff options
Diffstat (limited to 'src/libsystemd/sd-event')
-rw-r--r-- | src/libsystemd/sd-event/sd-event.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/libsystemd/sd-event/sd-event.c b/src/libsystemd/sd-event/sd-event.c index a21f7db8eb..9a9664cc00 100644 --- a/src/libsystemd/sd-event/sd-event.c +++ b/src/libsystemd/sd-event/sd-event.c @@ -1919,14 +1919,13 @@ static int process_signal(sd_event *e, uint32_t events) { int r; assert(e); - assert(e->signal_sources); assert_return(events == EPOLLIN, -EIO); for (;;) { struct signalfd_siginfo si; ssize_t ss; - sd_event_source *s; + sd_event_source *s = NULL; ss = read(e->signal_fd, &si, sizeof(si)); if (ss < 0) { @@ -1941,16 +1940,19 @@ static int process_signal(sd_event *e, uint32_t events) { read_one = true; - s = e->signal_sources[si.ssi_signo]; if (si.ssi_signo == SIGCHLD) { r = process_child(e); if (r < 0) return r; - if (r > 0 || !s) + if (r > 0) continue; - } else - if (!s) - return -EIO; + } + + if (e->signal_sources) + s = e->signal_sources[si.ssi_signo]; + + if (!s) + continue; s->signal.siginfo = si; r = source_set_pending(s, true); |