[systemd-devel] [PATCH] main: fix error message if PR_SET_CHILD_REAPER is not available

Marius Tolzmann tolzmann at molgen.mpg.de
Thu Aug 16 09:38:38 PDT 2012


---
 src/core/main.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/core/main.c b/src/core/main.c
index cdd77c1..8973637 100644
--- a/src/core/main.c
+++ b/src/core/main.c
@@ -1511,8 +1511,8 @@ int main(int argc, char *argv[]) {
                 /* Become reaper of our children */
                 r = prctl(PR_SET_CHILD_SUBREAPER, 1);
                 if (r < 0)
-                        log_error("Failed to prctl(PR_SET_CHILD_SUBREAPER): %s", strerror(-r));
-                if (r == -EINVAL)
+                        log_error("Failed to prctl(PR_SET_CHILD_SUBREAPER): %m");
+                if (r < 0 && errno == EINVAL)
                         log_error("Perhaps the kernel version is too old (< 3.4?)");
         }
 
-- 
1.7.5.2



More information about the systemd-devel mailing list