chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
importd: create a loopback btrfs file system for /var/lib/machines, if necessary
[elogind.git]
/
src
/
timesync
/
timesyncd.c
diff --git
a/src/timesync/timesyncd.c
b/src/timesync/timesyncd.c
index ed02e6db3a041a2107c85665a15e0ba9c8b00a3f..735668bedec960a64315676aa9df3f56248911e6 100644
(file)
--- a/
src/timesync/timesyncd.c
+++ b/
src/timesync/timesyncd.c
@@
-21,7
+21,6
@@
#include "sd-event.h"
#include "sd-daemon.h"
#include "sd-event.h"
#include "sd-daemon.h"
-#include "mkdir.h"
#include "capability.h"
#include "clock-util.h"
#include "network-util.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)
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;
}
return 0;
@@
-113,6
+112,10
@@
int main(int argc, char *argv[]) {
if (r < 0)
goto finish;
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);
assert_se(sigprocmask_many(SIG_BLOCK, SIGTERM, SIGINT, -1) == 0);
r = manager_new(&m);