summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-07-11 16:48:35 +0200
committerLennart Poettering <lennart@poettering.net>2014-07-11 16:50:10 +0200
commit92daebc0d0268c35f416c1665e0da3d4be5dd69f (patch)
tree79906b9603a516d6381c8609e486f7a199d6fbb9
parenteea1aadb5bb3fc121e8f66332249d05e5437debc (diff)
sd-event: don't require a signal event source to be enabled for the child event source to work
-rw-r--r--src/libsystemd/sd-event/sd-event.c16
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);