summaryrefslogtreecommitdiff
path: root/src/manager.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/manager.c')
-rw-r--r--src/manager.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/src/manager.c b/src/manager.c
index a643263213..bd4f4659af 100644
--- a/src/manager.c
+++ b/src/manager.c
@@ -2279,6 +2279,8 @@ int manager_deserialize(Manager *m, FILE *f, FDSet *fds) {
log_debug("Deserializing state...");
+ m->deserializing = true;
+
for (;;) {
Unit *u;
char name[UNIT_NAME_MAX+2];
@@ -2288,22 +2290,30 @@ int manager_deserialize(Manager *m, FILE *f, FDSet *fds) {
if (feof(f))
break;
- return -errno;
+ r = -errno;
+ goto finish;
}
char_array_0(name);
if ((r = manager_load_unit(m, strstrip(name), NULL, NULL, &u)) < 0)
- return r;
+ goto finish;
if ((r = unit_deserialize(u, f, fds)) < 0)
- return r;
+ goto finish;
}
- if (ferror(f))
- return -EIO;
+ if (ferror(f)) {
+ r = -EIO;
+ goto finish;
+ }
- return 0;
+ r = 0;
+
+finish:
+ m->deserializing = false;
+
+ return r;
}
int manager_reload(Manager *m) {