static usec_t get_startup_time(Context *c) {
const char
*interface = "org.freedesktop.systemd1.Manager",
- *property = "StartupTimestamp";
+ *property = "UserspaceTimestamp";
usec_t t = 0;
DBusMessage *reply = NULL;
{ '3', SPECIAL_RUNLEVEL3_TARGET },
{ '4', SPECIAL_RUNLEVEL4_TARGET },
{ '2', SPECIAL_RUNLEVEL2_TARGET },
- { 'S', SPECIAL_RESCUE_TARGET },
+ { '1', SPECIAL_RESCUE_TARGET },
};
const char
*interface = "org.freedesktop.systemd1.Unit",
#endif
if ((q = utmp_put_runlevel(runlevel, previous)) < 0) {
- log_error("Failed to write utmp record: %s", strerror(-q));
- r = q;
+ if (q != -ESRCH && q != -ENOENT) {
+ log_error("Failed to write utmp record: %s", strerror(-q));
+ r = q;
+ }
}
return r;
int main(int argc, char *argv[]) {
int r;
DBusError error;
- Context c;
+ Context c = {};
dbus_error_init(&error);
- zero(c);
#ifdef HAVE_AUDIT
c.audit_fd = -1;
#endif