chiark / gitweb /
systemd: treat reload failure as failure
[elogind.git] / src / core / unit.c
index d82408ccdef006779f57c6f9d8dd5c2ac98ec691..81d21622d08f50cc146250757d408fc0e2fada94 100644 (file)
 
 const UnitVTable * const unit_vtable[_UNIT_TYPE_MAX] = {
         [UNIT_SERVICE] = &service_vtable,
-        [UNIT_TIMER] = &timer_vtable,
         [UNIT_SOCKET] = &socket_vtable,
+        [UNIT_BUSNAME] = &busname_vtable,
         [UNIT_TARGET] = &target_vtable,
+        [UNIT_SNAPSHOT] = &snapshot_vtable,
         [UNIT_DEVICE] = &device_vtable,
         [UNIT_MOUNT] = &mount_vtable,
         [UNIT_AUTOMOUNT] = &automount_vtable,
-        [UNIT_SNAPSHOT] = &snapshot_vtable,
         [UNIT_SWAP] = &swap_vtable,
+        [UNIT_TIMER] = &timer_vtable,
         [UNIT_PATH] = &path_vtable,
         [UNIT_SLICE] = &slice_vtable,
         [UNIT_SCOPE] = &scope_vtable
@@ -1300,8 +1301,11 @@ int unit_reload(Unit *u) {
         if (state == UNIT_RELOADING)
                 return -EALREADY;
 
-        if (state != UNIT_ACTIVE)
+        if (state != UNIT_ACTIVE) {
+                log_warning_unit(u->id, "Unit %s cannot be reloaded because it is inactive.",
+                                 u->id);
                 return -ENOEXEC;
+        }
 
         following = unit_following(u);
         if (following) {
@@ -2178,7 +2182,7 @@ void unit_serialize_item(Unit *u, FILE *f, const char *key, const char *value) {
 
 int unit_deserialize(Unit *u, FILE *f, FDSet *fds) {
         size_t offset;
-        ExecRuntime **rt;
+        ExecRuntime **rt = NULL;
         int r;
 
         assert(u);