X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fshared%2Finstall.c;h=3b065445b071c6c42017ae863ca462246b3f0458;hb=086821244b5113f00a0ef993b78dc56aae2a8f6c;hp=af35b29df3ac9dbee0d5e4aee95588755f7a9215;hpb=f647962d64e844689f3e2acfce6102fc47e76df2;p=elogind.git diff --git a/src/shared/install.c b/src/shared/install.c index af35b29df..3b065445b 100644 --- a/src/shared/install.c +++ b/src/shared/install.c @@ -240,7 +240,7 @@ static int remove_marked_symlinks_fd( if (!de) break; - if (ignore_file(de->d_name)) + if (hidden_file(de->d_name)) continue; dirent_ensure_type(d, de); @@ -415,7 +415,7 @@ static int find_symlinks_fd( if (!de) return r; - if (ignore_file(de->d_name)) + if (hidden_file(de->d_name)) continue; dirent_ensure_type(d, de); @@ -538,7 +538,6 @@ static int find_symlinks_in_scope( assert(scope < _UNIT_FILE_SCOPE_MAX); assert(name); - /* First look in runtime config path */ r = get_config_path(scope, true, root_dir, &path); if (r < 0) @@ -662,7 +661,7 @@ int unit_file_unmask( goto finish; STRV_FOREACH(i, files) { - char *path; + _cleanup_free_ char *path = NULL; if (!unit_name_is_valid(*i, TEMPLATE_VALID)) { if (r == 0) @@ -678,21 +677,16 @@ int unit_file_unmask( q = null_or_empty_path(path); if (q > 0) { - if (unlink(path) >= 0) { - mark_symlink_for_removal(&remove_symlinks_to, path); + if (unlink(path) < 0) + q = -errno; + else { + q = mark_symlink_for_removal(&remove_symlinks_to, path); add_file_change(changes, n_changes, UNIT_FILE_UNLINK, path, NULL); - - free(path); - continue; } - - q = -errno; } if (q != -ENOENT && r == 0) r = q; - - free(path); } @@ -2100,7 +2094,7 @@ int unit_file_preset_all( if (!de) break; - if (ignore_file(de->d_name)) + if (hidden_file(de->d_name)) continue; if (!unit_name_is_valid(de->d_name, TEMPLATE_VALID)) @@ -2212,7 +2206,7 @@ int unit_file_get_list( if (!de) break; - if (ignore_file(de->d_name)) + if (hidden_file(de->d_name)) continue; if (!unit_name_is_valid(de->d_name, TEMPLATE_VALID))