X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fshared%2Finstall.c;h=3d2b5ae77fef417f84e71a7bf448b90d73144434;hb=bf2098e9e4837573d84dd4949b9c28a7372c93b9;hp=6172c42d692099eaee52b177bb4883fa7187c37f;hpb=e9ba5ef666085dbd85bec4bbb942d4c555b1053e;p=elogind.git diff --git a/src/shared/install.c b/src/shared/install.c index 6172c42d6..3d2b5ae77 100644 --- a/src/shared/install.c +++ b/src/shared/install.c @@ -220,7 +220,7 @@ static int remove_marked_symlinks_fd( instance_whitelist && !strv_contains(instance_whitelist, de->d_name)) { - _cleanup_free_ char *w; + _cleanup_free_ char *w = NULL; /* OK, the file is not listed directly * in the whitelist, so let's check if @@ -2190,6 +2190,7 @@ int unit_file_get_list( _cleanup_(unit_file_list_free_onep) UnitFileList *f = NULL; struct dirent *de; _cleanup_free_ char *path = NULL; + bool also = false; errno = 0; de = readdir(d); @@ -2243,7 +2244,7 @@ int unit_file_get_list( if (!path) return -ENOMEM; - r = unit_file_can_install(&paths, root_dir, path, true, NULL); + r = unit_file_can_install(&paths, root_dir, path, true, &also); if (r == -EINVAL || /* Invalid setting? */ r == -EBADMSG || /* Invalid format? */ r == -ENOENT /* Included file not found? */) @@ -2253,7 +2254,7 @@ int unit_file_get_list( else if (r > 0) f->state = UNIT_FILE_DISABLED; else - f->state = UNIT_FILE_STATIC; + f->state = also ? UNIT_FILE_INDIRECT : UNIT_FILE_STATIC; found: r = hashmap_put(h, basename(f->path), f); @@ -2263,7 +2264,7 @@ int unit_file_get_list( } } - return r; + return 0; } static const char* const unit_file_state_table[_UNIT_FILE_STATE_MAX] = {