summaryrefslogtreecommitdiff
path: root/src/dbus.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2011-06-27 13:47:03 +0200
committerLennart Poettering <lennart@poettering.net>2011-06-27 13:47:03 +0200
commit18fa6b2705aaef42041942f47f013e426640b6a4 (patch)
tree385d6801aa522cf550d4a9fc98673dadb62de99b /src/dbus.c
parent3084a7c453680fac7bdca9cf76bde397ec6a67de (diff)
dbus: send our finished signal when we are finished booting
Diffstat (limited to 'src/dbus.c')
-rw-r--r--src/dbus.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/dbus.c b/src/dbus.c
index 93a19a45cd..764c65cc0d 100644
--- a/src/dbus.c
+++ b/src/dbus.c
@@ -1274,3 +1274,42 @@ int bus_fdset_add_all(Manager *m, FDSet *fds) {
return 0;
}
+
+void bus_broadcast_finished(
+ Manager *m,
+ usec_t kernel_usec,
+ usec_t initrd_usec,
+ usec_t userspace_usec,
+ usec_t total_usec) {
+
+ DBusMessage *message;
+
+ assert(m);
+
+ message = dbus_message_new_signal("/org/freedesktop/systemd1", "org.freedesktop.systemd1.Manager", "StartupFinished");
+ if (!message) {
+ log_error("Out of memory.");
+ return;
+ }
+
+ assert_cc(sizeof(usec_t) == sizeof(uint64_t));
+ if (!dbus_message_append_args(message,
+ DBUS_TYPE_UINT64, &kernel_usec,
+ DBUS_TYPE_UINT64, &initrd_usec,
+ DBUS_TYPE_UINT64, &userspace_usec,
+ DBUS_TYPE_UINT64, &total_usec,
+ DBUS_TYPE_INVALID)) {
+ log_error("Out of memory.");
+ goto finish;
+ }
+
+
+ if (bus_broadcast(m, message) < 0) {
+ log_error("Out of memory.");
+ goto finish;
+ }
+
+finish:
+ if (m)
+ dbus_message_unref(message);
+}