X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Finstall.c;h=cfbd50ead954c93e518f19d05be6ef7f6402f5fe;hb=d68af58657ce0e99594dff199fbb9b319cf6af96;hp=b843ee156b5e9843f1a34023339170b00b1d7a33;hpb=729e3769c32242bbba26ea96900be005d52ce438;p=elogind.git diff --git a/src/install.c b/src/install.c index b843ee156..cfbd50ead 100644 --- a/src/install.c +++ b/src/install.c @@ -479,7 +479,6 @@ static int find_symlinks_fd( t = path_make_absolute(name, config_path); if (!t) { free(p); - free(dest); r = -ENOMEM; break; } @@ -1019,11 +1018,11 @@ static int unit_file_load( const char *path, bool allow_symlink) { - const ConfigItem items[] = { - { "Alias", config_parse_strv, 0, &info->aliases, "Install" }, - { "WantedBy", config_parse_strv, 0, &info->wanted_by, "Install" }, - { "Also", config_parse_also, 0, c, "Install" }, - { NULL, NULL, 0, NULL, NULL } + const ConfigTableItem items[] = { + { "Install", "Alias", config_parse_strv, 0, &info->aliases }, + { "Install", "WantedBy", config_parse_strv, 0, &info->wanted_by }, + { "Install", "Also", config_parse_also, 0, c }, + { NULL, NULL, NULL, 0, NULL } }; int fd; @@ -1044,7 +1043,7 @@ static int unit_file_load( return -ENOMEM; } - r = config_parse(path, f, NULL, items, true, info); + r = config_parse(path, f, NULL, config_item_table_lookup, (void*) items, true, info); fclose(f); if (r < 0) return r; @@ -1905,7 +1904,7 @@ int unit_file_get_list( } else if (r > 0) { f->state = UNIT_FILE_DISABLED; goto found; - } else if (r == 0) { + } else { f->state = UNIT_FILE_STATIC; goto found; }