summaryrefslogtreecommitdiff
path: root/src/core/manager.c
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2015-09-01 19:48:04 +0200
committerTom Gundersen <teg@jklm.no>2015-09-01 19:48:04 +0200
commitfc94c3260549c12892461be031c4b9dc122ca1ef (patch)
tree3b9bf7eccf1690daa57da5419d29554175605c20 /src/core/manager.c
parent332929623af07716530fb0d0a30e792b564ea486 (diff)
parentd06673212e7672da44d5147d1d393278d9b1b478 (diff)
Merge pull request #1111 from poettering/more-cgroup-fixes
More cgroup fixes
Diffstat (limited to 'src/core/manager.c')
-rw-r--r--src/core/manager.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/core/manager.c b/src/core/manager.c
index ede2a9910d..14f069ba97 100644
--- a/src/core/manager.c
+++ b/src/core/manager.c
@@ -573,6 +573,7 @@ int manager_new(ManagerRunningAs running_as, bool test_run, Manager **_m) {
m->ask_password_inotify_fd = -1;
m->have_ask_password = -EINVAL; /* we don't know */
+ m->first_boot = -1;
m->test_run = test_run;
@@ -2998,12 +2999,14 @@ void manager_set_first_boot(Manager *m, bool b) {
if (m->running_as != MANAGER_SYSTEM)
return;
- m->first_boot = b;
+ if (m->first_boot != (int) b) {
+ if (b)
+ (void) touch("/run/systemd/first-boot");
+ else
+ (void) unlink("/run/systemd/first-boot");
+ }
- if (m->first_boot)
- touch("/run/systemd/first-boot");
- else
- unlink("/run/systemd/first-boot");
+ m->first_boot = b;
}
void manager_status_printf(Manager *m, StatusType type, const char *status, const char *format, ...) {