diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/fdset.c | 1 | ||||
-rw-r--r-- | src/systemctl.c | 7 |
2 files changed, 5 insertions, 3 deletions
diff --git a/src/fdset.c b/src/fdset.c index b6d5286f82..ad7cd2949c 100644 --- a/src/fdset.c +++ b/src/fdset.c @@ -144,7 +144,6 @@ finish: set_free(MAKE_SET(s)); return r; - } int fdset_cloexec(FDSet *fds, bool b) { diff --git a/src/systemctl.c b/src/systemctl.c index 9a85383dba..167c6a5b7f 100644 --- a/src/systemctl.c +++ b/src/systemctl.c @@ -4680,9 +4680,12 @@ static int halt_main(DBusConnection *bus) { if (!arg_dry && !arg_immediate) return start_with_fallback(bus); - if (!arg_no_wtmp) - if ((r = utmp_put_shutdown(0)) < 0) + if (!arg_no_wtmp) { + if (sd_booted() > 0) + log_debug("Not writing utmp record, assuming that systemd-update-utmp is used."); + else if ((r = utmp_put_shutdown(0)) < 0) log_warning("Failed to write utmp record: %s", strerror(-r)); + } if (!arg_no_sync) sync(); |