X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fshared%2Finstall.c;h=190c554347ac200f3d9462e82d94552e002fb5e5;hb=a1948c7bfeb87b54bc7715a44490c01593ee6e23;hp=c7cb5220281a84f913db6576446a655a600321f1;hpb=ac78d81a35fae1c10464992dac25f1527a05cbc9;p=elogind.git diff --git a/src/shared/install.c b/src/shared/install.c index c7cb52202..190c55434 100644 --- a/src/shared/install.c +++ b/src/shared/install.c @@ -1128,7 +1128,7 @@ static int unit_file_search( * enablement was requested. We will check if it is * possible to load template unit file. */ - _cleanup_free_ char *template = NULL, *template_dir = NULL; + _cleanup_free_ char *template = NULL; template = unit_name_template(info->name); if (!template) @@ -1776,7 +1776,7 @@ UnitFileState unit_file_get_state( int unit_file_query_preset(UnitFileScope scope, const char *root_dir, const char *name) { _cleanup_strv_free_ char **files = NULL; - char **i; + char **p; int r; assert(scope >= 0); @@ -1804,17 +1804,10 @@ int unit_file_query_preset(UnitFileScope scope, const char *root_dir, const char if (r < 0) return r; - STRV_FOREACH(i, files) { - _cleanup_free_ char *buf = NULL; + STRV_FOREACH(p, files) { _cleanup_fclose_ FILE *f; - const char *p; - - if (root_dir) - p = buf = strjoin(root_dir, "/", *i, NULL); - else - p = *i; - f = fopen(p, "re"); + f = fopen(*p, "re"); if (!f) { if (errno == ENOENT) continue;