chiark / gitweb /
journal-remote: fix client_cert memory leak
[elogind.git] / src / timesync / timesyncd.c
index ed02e6db3a041a2107c85665a15e0ba9c8b00a3f..2a73dac033c8fe1570febd1ac2fb16a3e1fdb26c 100644 (file)
@@ -73,7 +73,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 +113,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);