chiark / gitweb /
core: output unit status output strings to console, only if we actually are changing...
[elogind.git] / src / core / target.c
index 981424132be6435129fe0911f30583fca80b8dca..33fb66bc3fe4800617d521d53bac86c55bde964d 100644 (file)
@@ -137,7 +137,7 @@ static int target_start(Unit *u) {
         assert(t->state == TARGET_DEAD);
 
         target_set_state(t, TARGET_ACTIVE);
-        return 0;
+        return 1;
 }
 
 static int target_stop(Unit *u) {
@@ -147,7 +147,7 @@ static int target_stop(Unit *u) {
         assert(t->state == TARGET_ACTIVE);
 
         target_set_state(t, TARGET_DEAD);
-        return 0;
+        return 1;
 }
 
 static int target_serialize(Unit *u, FILE *f, FDSet *fds) {
@@ -184,13 +184,13 @@ static int target_deserialize_item(Unit *u, const char *key, const char *value,
         return 0;
 }
 
-static UnitActiveState target_active_state(Unit *u) {
+_pure_ static UnitActiveState target_active_state(Unit *u) {
         assert(u);
 
         return state_translation_table[TARGET(u)->state];
 }
 
-static const char *target_sub_state_to_string(Unit *u) {
+_pure_ static const char *target_sub_state_to_string(Unit *u) {
         assert(u);
 
         return target_state_to_string(TARGET(u)->state);
@@ -205,6 +205,7 @@ DEFINE_STRING_TABLE_LOOKUP(target_state, TargetState);
 
 const UnitVTable target_vtable = {
         .object_size = sizeof(Target),
+
         .sections =
                 "Unit\0"
                 "Target\0"
@@ -225,7 +226,7 @@ const UnitVTable target_vtable = {
         .sub_state_to_string = target_sub_state_to_string,
 
         .bus_interface = "org.freedesktop.systemd1.Target",
-        .bus_message_handler = bus_target_message_handler,
+        .bus_vtable = bus_target_vtable,
 
         .status_message_formats = {
                 .finished_start_job = {