summaryrefslogtreecommitdiff
path: root/src/manager.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-07-10 04:51:03 +0200
committerLennart Poettering <lennart@poettering.net>2010-07-10 04:51:03 +0200
commit82c64bf578623f0678b4de1ac08c6bd8e5d95662 (patch)
tree97306aeb4ecfb2b1fa7e3523d91bf2d879c3dd40 /src/manager.c
parent1e001f52d20a4685c9e8cf3cfa690021ca05c9e7 (diff)
snapshot: fix deserialization
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) {