chiark / gitweb /
logind: implement suspend/hibernate calls with inhibition logic
[elogind.git] / src / core / dbus-manager.c
index 770fce12099e7a7808801553a629892da26a2bd0..bdc919221716ef44ac86304d342f12074c067b6b 100644 (file)
@@ -31,6 +31,7 @@
 #include "dbus-common.h"
 #include "install.h"
 #include "watchdog.h"
+#include "hwclock.h"
 
 #define BUS_MANAGER_INTERFACE_BEGIN                                     \
         " <interface name=\"org.freedesktop.systemd1.Manager\">\n"
         "  <signal name=\"JobNew\">\n"                                  \
         "   <arg name=\"id\" type=\"u\"/>\n"                            \
         "   <arg name=\"job\" type=\"o\"/>\n"                           \
+        "   <arg name=\"unit\" type=\"s\"/>\n"                          \
         "  </signal>\n"                                                 \
         "  <signal name=\"JobRemoved\">\n"                              \
         "   <arg name=\"id\" type=\"u\"/>\n"                            \
         "   <arg name=\"job\" type=\"o\"/>\n"                           \
+        "   <arg name=\"unit\" type=\"s\"/>\n"                          \
         "   <arg name=\"result\" type=\"s\"/>\n"                        \
         "  </signal>"                                                   \
         "  <signal name=\"StartupFinished\">\n"                         \
@@ -294,17 +297,23 @@ static int bus_manager_append_tainted(DBusMessageIter *i, const char *property,
         assert(m);
 
         if (m->taint_usr)
-                e = stpcpy(e, "usr-separate-fs ");
+                e = stpcpy(e, "split-usr:");
 
         if (readlink_malloc("/etc/mtab", &p) < 0)
-                e = stpcpy(e, "etc-mtab-not-symlink ");
+                e = stpcpy(e, "mtab-not-symlink:");
         else
                 free(p);
 
         if (access("/proc/cgroups", F_OK) < 0)
-                stpcpy(e, "cgroups-missing ");
+                stpcpy(e, "cgroups-missing:");
 
-        t = strstrip(buf);
+        if (hwclock_is_localtime() > 0)
+                stpcpy(e, "local-hwclock:");
+
+        if (endswith(buf, ":"))
+                buf[strlen(buf)-1] = 0;
+
+        t = buf;
 
         if (!dbus_message_iter_append_basic(i, DBUS_TYPE_STRING, &t))
                 return -ENOMEM;