]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/core/dbus-util.c
tree-wide: remove Lennart's copyright lines
[thirdparty/systemd.git] / src / core / dbus-util.c
index 2aa682f10310df7961c185ac1b61a3c22ba602cf..f4fbb72cb99c52246d62f2b3d6bcb930104ba39d 100644 (file)
@@ -1,9 +1,4 @@
 /* SPDX-License-Identifier: LGPL-2.1+ */
-/***
-  This file is part of systemd.
-
-  Copyright 2010 Lennart Poettering
-***/
 
 #include "bus-util.h"
 #include "dbus-util.h"
@@ -13,6 +8,26 @@
 #include "user-util.h"
 #include "unit.h"
 
+int bus_property_get_triggered_unit(
+                sd_bus *bus,
+                const char *path,
+                const char *interface,
+                const char *property,
+                sd_bus_message *reply,
+                void *userdata,
+                sd_bus_error *error) {
+
+        Unit *u = userdata, *trigger;
+
+        assert(bus);
+        assert(reply);
+        assert(u);
+
+        trigger = UNIT_TRIGGER(u);
+
+        return sd_bus_message_append(reply, "s", trigger ? trigger->id : NULL);
+}
+
 BUS_DEFINE_SET_TRANSIENT(mode_t, "u", uint32_t, mode_t, "%040o");
 BUS_DEFINE_SET_TRANSIENT(unsigned, "u", uint32_t, unsigned, "%" PRIu32);
 BUS_DEFINE_SET_TRANSIENT_STRING_WITH_CHECK(user, valid_user_group_name_or_id);