[systemd-commits] 2 commits - src/sd-daemon.c src/util.c

Lennart Poettering lennart at kemper.freedesktop.org
Thu Feb 2 10:11:25 PST 2012


 src/sd-daemon.c |    4 ++++
 src/util.c      |    3 ++-
 2 files changed, 6 insertions(+), 1 deletion(-)

New commits:
commit ec3f9b53f882623e6572258ba15234b1ee108b7f
Author: Chris Paulson-Ellis <chris at edesix.com>
Date:   Thu Feb 2 17:32:05 2012 +0000

    util: prevent daemon-reload from reaping service processes.
    
    The reaping of generator processes run as part of a daemon-reload should not
    call waitid(PID_ALL). The waitid() call in execute_directory() is intended only
    to reap the executed processes, but if a service process exits at about the
    same time as a daemon-reload, then that service process is reaped as well,
    preventing it from being reaped in the proper place in
    manager_dispatch_sigchld().
    
    Fixes https://bugs.freedesktop.org/show_bug.cgi?id=43625

diff --git a/src/util.c b/src/util.c
index 58a0aeb..11f77ab 100644
--- a/src/util.c
+++ b/src/util.c
@@ -4623,11 +4623,12 @@ void execute_directory(const char *directory, DIR *d, char *argv[]) {
         }
 
         while (!hashmap_isempty(pids)) {
+                pid_t pid = PTR_TO_UINT(hashmap_first_key(pids));
                 siginfo_t si;
                 char *path;
 
                 zero(si);
-                if (waitid(P_ALL, 0, &si, WEXITED) < 0) {
+                if (waitid(P_PID, pid, &si, WEXITED) < 0) {
 
                         if (errno == EINTR)
                                 continue;

commit ce095579172778ebde6a20176875ee2702ec3340
Author: Alvaro Soliverez <alvaro.soliverez at collabora.co.uk>
Date:   Mon Nov 7 15:10:25 2011 -0300

    sd-daemon: support for building sd-daemon.c with Bionic (Android)
    
    sd-daemon.h is a drop-in file, so we should make sure it doesn't break
    builds for anybody.
    
    https://bugs.freedesktop.org/show_bug.cgi?id=42675

diff --git a/src/sd-daemon.c b/src/sd-daemon.c
index e68b708..763e079 100644
--- a/src/sd-daemon.c
+++ b/src/sd-daemon.c
@@ -32,7 +32,11 @@
 #include <sys/stat.h>
 #include <sys/socket.h>
 #include <sys/un.h>
+#ifdef __BIONIC__
+#include <linux/fcntl.h>
+#else
 #include <sys/fcntl.h>
+#endif
 #include <netinet/in.h>
 #include <stdlib.h>
 #include <errno.h>



More information about the systemd-commits mailing list