chiark / gitweb /
core: either ignore or handle mount failures
[elogind.git] / src / core / target.c
index 981424132be6435129fe0911f30583fca80b8dca..5f64402475976643b1532ba9e9dd0c24cecd997c 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <errno.h>
-#include <signal.h>
-#include <unistd.h>
 
 #include "unit.h"
 #include "target.h"
-#include "load-fragment.h"
 #include "log.h"
 #include "dbus-target.h"
 #include "special.h"
@@ -107,7 +103,7 @@ static int target_load(Unit *u) {
         return 0;
 }
 
-static int target_coldplug(Unit *u) {
+static int target_coldplug(Unit *u, Hashmap *deferred_work) {
         Target *t = TARGET(u);
 
         assert(t);
@@ -137,7 +133,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 +143,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 +180,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 +201,7 @@ DEFINE_STRING_TABLE_LOOKUP(target_state, TargetState);
 
 const UnitVTable target_vtable = {
         .object_size = sizeof(Target),
+
         .sections =
                 "Unit\0"
                 "Target\0"
@@ -225,7 +222,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 = {