X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Finstall.c;h=92561168059422f40ca15af0784056ec5b9177a4;hb=b8b5e648cacc8d73c55fdffbb3466ecd8146131a;hp=cfbd50ead954c93e518f19d05be6ef7f6402f5fe;hpb=263653e10353d8ad155f1faba01981816a2bb712;p=elogind.git diff --git a/src/install.c b/src/install.c index cfbd50ead..925611680 100644 --- a/src/install.c +++ b/src/install.c @@ -72,9 +72,8 @@ static int get_config_path(UnitFileScope scope, bool runtime, const char *root_d case UNIT_FILE_SYSTEM: if (root_dir && runtime) - return -EINVAL; - - if (runtime) + asprintf(&p, "%s/run/systemd/system", root_dir); + else if (runtime) p = strdup("/run/systemd/system"); else if (root_dir) asprintf(&p, "%s/%s", root_dir, SYSTEM_CONFIG_UNIT_PATH); @@ -1572,10 +1571,10 @@ UnitFileState unit_file_get_state( } if (lstat(path, &st) < 0) { + r = -errno; if (errno == ENOENT) continue; - r = -errno; goto finish; } @@ -1854,7 +1853,7 @@ int unit_file_get_list( r = dirent_ensure_type(d, de); if (r < 0) { - if (errno == ENOENT) + if (r == -ENOENT) continue; goto finish;