X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Fcore%2Fmain.c;h=789976108a7f16de8448581da9d38ef56310a16d;hp=4d21dd97a3e3873dd1d4cf431d0c8c650815a448;hb=b3680f49e20c51e31c8dea84a11207df7b8f0100;hpb=b92bea5d2a9481de69bb627a7b442a9f58fca43d diff --git a/src/core/main.c b/src/core/main.c index 4d21dd97a..789976108 100644 --- a/src/core/main.c +++ b/src/core/main.c @@ -704,7 +704,7 @@ static int parse_config_file(void) { { NULL, NULL, NULL, 0, NULL } }; - FILE *f; + FILE _cleanup_fclose_ *f; const char *fn; int r; @@ -722,8 +722,6 @@ static int parse_config_file(void) { if (r < 0) log_warning("Failed to parse configuration file: %s", strerror(-r)); - fclose(f); - return 0; } @@ -1090,7 +1088,7 @@ static int version(void) { return 0; } -static int prepare_reexecute(Manager *m, FILE **_f, FDSet **_fds, bool serialize_jobs) { +static int prepare_reexecute(Manager *m, FILE **_f, FDSet **_fds, bool switching_root) { FILE *f = NULL; FDSet *fds = NULL; int r; @@ -1115,7 +1113,7 @@ static int prepare_reexecute(Manager *m, FILE **_f, FDSet **_fds, bool serialize goto fail; } - r = manager_serialize(m, f, fds, serialize_jobs); + r = manager_serialize(m, f, fds, switching_root); if (r < 0) { log_error("Failed to serialize state: %s", strerror(-r)); goto fail; @@ -1782,7 +1780,7 @@ int main(int argc, char *argv[]) { case MANAGER_REEXECUTE: - if (prepare_reexecute(m, &serialization, &fds, true) < 0) + if (prepare_reexecute(m, &serialization, &fds, false) < 0) goto finish; reexecute = true; @@ -1796,7 +1794,7 @@ int main(int argc, char *argv[]) { m->switch_root = m->switch_root_init = NULL; if (!switch_root_init) - if (prepare_reexecute(m, &serialization, &fds, false) < 0) + if (prepare_reexecute(m, &serialization, &fds, true) < 0) goto finish; reexecute = true;