chiark / gitweb /
Fix service file to match installed elogind binary location
[elogind.git] / src / update-utmp / update-utmp.c
index 655615fc0bf48710460fd097e6beafa6a6594e8e..5e2d2c60e600df57e31917a317c361339933601a 100644 (file)
@@ -49,6 +49,7 @@ typedef struct Context {
 #endif
 } Context;
 
+#if 0 /// UNNEEDED by elogind
 static usec_t get_startup_time(Context *c) {
         _cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL;
         usec_t t = 0;
@@ -72,7 +73,6 @@ static usec_t get_startup_time(Context *c) {
         return t;
 }
 
-#if 0 /// UNNEEDED by elogind
 static int get_current_runlevel(Context *c) {
         static const struct {
                 const int runlevel;
@@ -112,7 +112,7 @@ static int get_current_runlevel(Context *c) {
                 if (r < 0)
                         return log_warning_errno(r, "Failed to get state: %s", bus_error_message(&error, r));
 
-                if (streq(state, "active") || streq(state, "reloading"))
+                if (STR_IN_SET(state, "active", "reloading"))
                         return table[i].runlevel;
         }
 
@@ -137,9 +137,13 @@ static int on_reboot(Context *c) {
                 }
 #endif
 
+#if 0 /// systemd hasn't started the system, so elogind always uses NOW()
         /* If this call fails it will return 0, which
          * utmp_put_reboot() will then fix to the current time */
         t = get_startup_time(c);
+#else
+        t = now(CLOCK_REALTIME);
+#endif // 0
 
         q = utmp_put_reboot(t);
         if (q < 0) {