]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
systemd: warn when setrlimit fails
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 17 Aug 2016 16:06:07 +0000 (12:06 -0400)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 19 Aug 2016 02:29:56 +0000 (22:29 -0400)
This should make it easier to figure things out.

src/core/main.c

index 02324d325ee44bf8ab52d1c061cdbab55f67f1ee..3f4fa74fed8af236bb3191591751d738fc5f29ea 100644 (file)
@@ -1505,7 +1505,8 @@ int main(int argc, char *argv[]) {
         if (getpid() == 1) {
                 /* Don't limit the core dump size, so that coredump handlers such as systemd-coredump (which honour the limit)
                  * will process core dumps for system services by default. */
-                (void) setrlimit(RLIMIT_CORE, &RLIMIT_MAKE_CONST(RLIM_INFINITY));
+                if (setrlimit(RLIMIT_CORE, &RLIMIT_MAKE_CONST(RLIM_INFINITY)) < 0)
+                        log_warning_errno(errno, "Failed to set RLIMIT_CORE: %m");
 
                 /* But at the same time, turn off the core_pattern logic by default, so that no coredumps are stored
                  * until the systemd-coredump tool is enabled via sysctl. */