From: Yu Watanabe Date: Sat, 8 Apr 2023 08:56:38 +0000 (+0900) Subject: os-util: drop redundant declaration of load_os_release_pairs() X-Git-Tag: v254-rc1~770^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8c14d828d4eef89f4800290dc384727f5fbd4b7e;p=thirdparty%2Fsystemd.git os-util: drop redundant declaration of load_os_release_pairs() --- diff --git a/src/basic/os-util.c b/src/basic/os-util.c index 005ccf790b9..5f1c26b87c2 100644 --- a/src/basic/os-util.c +++ b/src/basic/os-util.c @@ -309,18 +309,6 @@ int _parse_os_release(const char *root, ...) { return r; } -int load_os_release_pairs(const char *root, char ***ret) { - _cleanup_fclose_ FILE *f = NULL; - _cleanup_free_ char *p = NULL; - int r; - - r = fopen_os_release(root, &p, &f); - if (r < 0) - return r; - - return load_env_file_pairs(f, p, ret); -} - int load_os_release_pairs_with_prefix(const char *root, const char *prefix, char ***ret) { _cleanup_strv_free_ char **os_release_pairs = NULL, **os_release_pairs_prefixed = NULL; int r; @@ -355,9 +343,6 @@ int load_extension_release_pairs(const char *root, ImageClass image_class, const _cleanup_free_ char *p = NULL; int r; - assert(image_class >= 0); - assert(image_class < _IMAGE_CLASS_MAX); - r = fopen_extension_release(root, image_class, extension, relax_extension_release_check, &p, &f); if (r < 0) return r; diff --git a/src/basic/os-util.h b/src/basic/os-util.h index 0cd55f87c6c..01dcde7a808 100644 --- a/src/basic/os-util.h +++ b/src/basic/os-util.h @@ -44,7 +44,9 @@ int _parse_os_release(const char *root, ...) _sentinel_; #define parse_os_release(root, ...) _parse_os_release(root, __VA_ARGS__, NULL) int load_extension_release_pairs(const char *root, ImageClass image_class, const char *extension, bool relax_extension_release_check, char ***ret); -int load_os_release_pairs(const char *root, char ***ret); +static inline int load_os_release_pairs(const char *root, char ***ret) { + return load_extension_release_pairs(root, _IMAGE_CLASS_INVALID, NULL, false, ret); +} int load_os_release_pairs_with_prefix(const char *root, const char *prefix, char ***ret); int os_release_support_ended(const char *support_end, bool quiet, usec_t *ret_eol);