From: Yu Watanabe Date: Fri, 11 Apr 2025 02:43:32 +0000 (+0900) Subject: kbd-util: use string_hash_ops_free and set_to_strv() X-Git-Tag: v258-rc1~829^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=002ff90d8cb5e7f0924916802e0da86d18db1a79;p=thirdparty%2Fsystemd.git kbd-util: use string_hash_ops_free and set_to_strv() --- diff --git a/src/shared/kbd-util.c b/src/shared/kbd-util.c index 60e0429b82a..fa06d8a9653 100644 --- a/src/shared/kbd-util.c +++ b/src/shared/kbd-util.c @@ -83,7 +83,7 @@ static int keymap_recurse_dir_callback( } int get_keymaps(char ***ret) { - _cleanup_set_free_free_ Set *keymaps = NULL; + _cleanup_set_free_ Set *keymaps = NULL; _cleanup_strv_free_ char **keymap_dirs = NULL; int r; @@ -91,7 +91,7 @@ int get_keymaps(char ***ret) { if (r < 0) return r; - keymaps = set_new(&string_hash_ops); + keymaps = set_new(&string_hash_ops_free); if (!keymaps) return -ENOMEM; @@ -114,14 +114,10 @@ int get_keymaps(char ***ret) { log_debug_errno(r, "Failed to read keymap list from %s, ignoring: %m", *dir); } - _cleanup_strv_free_ char **l = set_get_strv(keymaps); + _cleanup_strv_free_ char **l = set_to_strv(&keymaps); if (!l) return -ENOMEM; - keymaps = set_free(keymaps); /* If we got the strv above, then do a set_free() rather than - * set_free_free() since the entries of the set are now owned by the - * strv */ - if (strv_isempty(l)) return -ENOENT;