From: Mike Yuan Date: Mon, 13 Nov 2023 09:08:24 +0000 (+0800) Subject: conf-parser: remove unused condition X-Git-Tag: v255-rc2~35 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8ea288db018c7dfe0016d51d4538539bab4ab6de;p=thirdparty%2Fsystemd.git conf-parser: remove unused condition Follow-up for 9ac2f3c4d2cc02eda32034980461c21232bb746c config_parse() returns 0 only on ENOENT, which can never happen since we pass the FILE stream. --- diff --git a/src/shared/conf-parser.c b/src/shared/conf-parser.c index f552e9aed2f..12312f55008 100644 --- a/src/shared/conf-parser.c +++ b/src/shared/conf-parser.c @@ -564,14 +564,12 @@ static int config_parse_many_files( r = config_parse(NULL, *fn, f, sections, lookup, table, flags, userdata, &st); if (r < 0) return r; - if (r > 0) { - if (ret_stats_by_path) { - r = hashmap_put_stats_by_path(&stats_by_path, *fn, &st); - if (r < 0) - return r; - } + assert(r > 0); - break; + if (ret_stats_by_path) { + r = hashmap_put_stats_by_path(&stats_by_path, *fn, &st); + if (r < 0) + return r; } } @@ -583,8 +581,7 @@ static int config_parse_many_files( r = config_parse(NULL, path_dropin, f_dropin, sections, lookup, table, flags, userdata, &st); if (r < 0) return r; - if (r == 0) - continue; + assert(r > 0); if (ret_stats_by_path) { r = hashmap_put_stats_by_path(&stats_by_path, path_dropin, &st);