From: Yu Watanabe Date: Sat, 18 Jan 2025 19:18:04 +0000 (+0900) Subject: boot: introduce _cleanup_strv_free_ X-Git-Tag: v258-rc1~1552^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F36071%2Fhead;p=thirdparty%2Fsystemd.git boot: introduce _cleanup_strv_free_ --- diff --git a/src/boot/boot.c b/src/boot/boot.c index f785a6daf41..27512612346 100644 --- a/src/boot/boot.c +++ b/src/boot/boot.c @@ -683,7 +683,7 @@ static bool menu_run( bool new_mode = true, clear = true; bool refresh = true, highlight = false; size_t x_start = 0, y_start = 0, y_status = 0, x_max, y_max; - _cleanup_(strv_freep) char16_t **lines = NULL; + _cleanup_strv_free_ char16_t **lines = NULL; _cleanup_free_ char16_t *clearline = NULL, *separator = NULL, *status = NULL; uint64_t timeout_efivar_saved = config->timeout_sec_efivar; uint32_t timeout_remain = config->timeout_sec == TIMEOUT_MENU_FORCE ? 0 : config->timeout_sec; diff --git a/src/boot/cpio.c b/src/boot/cpio.c index 6cbecc53aa2..fc5e303d7e6 100644 --- a/src/boot/cpio.c +++ b/src/boot/cpio.c @@ -318,7 +318,7 @@ EFI_STATUS pack_cpio( size_t dirent_size = 0, buffer_size = 0, n_items = 0, n_allocated = 0; _cleanup_free_ char16_t *rel_dropin_dir = NULL; _cleanup_free_ EFI_FILE_INFO *dirent = NULL; - _cleanup_(strv_freep) char16_t **items = NULL; + _cleanup_strv_free_ char16_t **items = NULL; _cleanup_free_ void *buffer = NULL; uint32_t inode = 1; /* inode counter, so that each item gets a new inode */ EFI_STATUS err; diff --git a/src/boot/stub.c b/src/boot/stub.c index e1ccb34a0b8..e74b7db95ad 100644 --- a/src/boot/stub.c +++ b/src/boot/stub.c @@ -547,7 +547,7 @@ static EFI_STATUS load_addons( NamedAddon **ucode_addons, /* Ditto */ size_t *n_ucode_addons) { - _cleanup_(strv_freep) char16_t **items = NULL; + _cleanup_strv_free_ char16_t **items = NULL; _cleanup_file_close_ EFI_FILE *root = NULL; size_t n_items = 0, n_allocated = 0; EFI_STATUS err; diff --git a/src/boot/util.h b/src/boot/util.h index 17af86d41c6..49ba1196137 100644 --- a/src/boot/util.h +++ b/src/boot/util.h @@ -169,6 +169,8 @@ static inline void strv_freep(char16_t ***p) { strv_free(*p); } +#define _cleanup_strv_free_ _cleanup_(strv_freep) + EFI_STATUS open_directory(EFI_FILE *root_dir, const char16_t *path, EFI_FILE **ret); /* Conversion between EFI_PHYSICAL_ADDRESS and pointers is not obvious. The former is always 64-bit, even on