chiark / gitweb /
importd: create a loopback btrfs file system for /var/lib/machines, if necessary
[elogind.git] / src / timesync / timesyncd.c
index ed02e6db3a041a2107c85665a15e0ba9c8b00a3f..735668bedec960a64315676aa9df3f56248911e6 100644 (file)
@@ -21,7 +21,6 @@
 
 #include "sd-event.h"
 #include "sd-daemon.h"
-#include "mkdir.h"
 #include "capability.h"
 #include "clock-util.h"
 #include "network-util.h"
@@ -73,7 +72,7 @@ static int load_clock_timestamp(uid_t uid, gid_t gid) {
                          format_timestamp(date, sizeof(date), min));
 
                 if (clock_settime(CLOCK_REALTIME, timespec_store(&ts, min)) < 0)
-                        log_error("Failed to restore system clock: %m");
+                        log_error_errno(errno, "Failed to restore system clock: %m");
         }
 
         return 0;
@@ -113,6 +112,10 @@ int main(int argc, char *argv[]) {
         if (r < 0)
                 goto finish;
 
+        /* We need one process for ourselves, plus one thread for the asynchronous resolver */
+        if (setrlimit(RLIMIT_NPROC, &RLIMIT_MAKE_CONST(2)) < 0)
+                log_warning_errno(errno, "Failed to lower RLIMIT_NPROC to 2: %m");
+
         assert_se(sigprocmask_many(SIG_BLOCK, SIGTERM, SIGINT, -1) == 0);
 
         r = manager_new(&m);