chiark / gitweb /
Prep v239: Add support for the new 'suspend-then-hibernate' method.
[elogind.git] / src / shared / bus-util.c
index 020fa885af1c66753d704f66ce532f45910ee0b6..c3be78769c47ff0a702ee5bce59335768ca5c1fc 100644 (file)
@@ -1,9 +1,4 @@
 /* SPDX-License-Identifier: LGPL-2.1+ */
-/***
-  This file is part of systemd.
-
-  Copyright 2013 Lennart Poettering
-***/
 
 #include <errno.h>
 #include <fcntl.h>
@@ -700,7 +695,8 @@ int bus_print_property(const char *name, sd_bus_message *m, bool value, bool all
                 /* Yes, heuristics! But we can change this check
                  * should it turn out to not be sufficient */
 
-                if (endswith(name, "Timestamp") || STR_IN_SET(name, "NextElapseUSecRealtime", "LastTriggerUSec")) {
+                if (endswith(name, "Timestamp") ||
+                    STR_IN_SET(name, "NextElapseUSecRealtime", "LastTriggerUSec", "TimeUSec", "RTCTimeUSec")) {
                         char timestamp[FORMAT_TIMESTAMP_MAX];
                         const char *t;
 
@@ -1094,9 +1090,9 @@ static int map_basic(sd_bus *bus, const char *member, sd_bus_message *m, unsigne
                         return r;
 
                 if (flags & BUS_MAP_BOOLEAN_AS_BOOL)
-                        * (bool*) userdata = !!b;
+                        *(bool*) userdata = b;
                 else
-                        * (int*) userdata = b;
+                        *(int*) userdata = b;
 
                 return 0;
         }
@@ -1306,16 +1302,18 @@ int bus_connect_transport(BusTransport transport, const char *host, bool user, s
 #if 0 /// elogind does not support a user bus
                 if (user)
                         r = sd_bus_default_user(&bus);
-#endif // 0
                 else {
                         if (sd_booted() <= 0) {
                                 /* Print a friendly message when the local system is actually not running systemd as PID 1. */
-                                log_error("System has not been booted with elogind as init system (PID 1). Can't operate.");
+                                log_error("System has not been booted with systemd as init system (PID 1). Can't operate.");
 
                                 return -EHOSTDOWN;
                         }
+#endif // 0
                         r = sd_bus_default_system(&bus);
+#if 0 /// No closing bracket with elogind... Ain't we simple? ;-)
                 }
+#endif // 0
                 break;
 
         case BUS_TRANSPORT_REMOTE:
@@ -1413,7 +1411,7 @@ int bus_property_set_bool(
         if (r < 0)
                 return r;
 
-        *(bool *) userdata = !!b;
+        *(bool*) userdata = b;
         return 0;
 }