summaryrefslogtreecommitdiff
path: root/src/unit.h
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-07-21 05:00:29 +0200
committerLennart Poettering <lennart@poettering.net>2010-07-21 05:00:29 +0200
commita7f241db3f1ae96ab2708092e1b31d2feb989947 (patch)
treed48588845b8d22658eb7a46bee49d58ec528716d /src/unit.h
parent672c48cc065251ddbdc3926221e8a7718241cccd (diff)
unit: deduce following unit value dynamically instead of statically, to avoid dangling pointers
Diffstat (limited to 'src/unit.h')
-rw-r--r--src/unit.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/unit.h b/src/unit.h
index f1171270f8..34e86d1086 100644
--- a/src/unit.h
+++ b/src/unit.h
@@ -176,9 +176,6 @@ struct Meta {
/* GC queue */
LIST_FIELDS(Meta, gc_queue);
- /* This follows another unit in state */
- Unit *following;
-
/* Used during GC sweeps */
unsigned gc_marker;
@@ -313,6 +310,9 @@ struct UnitVTable {
/* Called for each message received on the bus */
DBusHandlerResult (*bus_message_handler)(Unit *u, DBusConnection *c, DBusMessage *message);
+ /* Return the unit this unit is following */
+ Unit *(*following)(Unit *u);
+
/* This is called for each unit type and should be used to
* enumerate existing devices and load them. However,
* everything that is loaded here should still stay in
@@ -475,6 +475,8 @@ bool unit_need_daemon_reload(Unit *u);
void unit_reset_maintenance(Unit *u);
+Unit *unit_following(Unit *u);
+
const char *unit_type_to_string(UnitType i);
UnitType unit_type_from_string(const char *s);