[systemd-commits] src/libsystemd

Lennart Poettering lennart at kemper.freedesktop.org
Fri Jul 11 10:06:13 PDT 2014


 src/libsystemd/sd-event/sd-event.c |   16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

New commits:
commit 92daebc0d0268c35f416c1665e0da3d4be5dd69f
Author: Lennart Poettering <lennart at poettering.net>
Date:   Fri Jul 11 16:48:35 2014 +0200

    sd-event: don't require a signal event source to be enabled for the child event source to work

diff --git a/src/libsystemd/sd-event/sd-event.c b/src/libsystemd/sd-event/sd-event.c
index a21f7db..9a9664c 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);



More information about the systemd-commits mailing list