diff --git a/meson.build b/meson.build index ef84bd2512..8bd21e6437 100644 --- a/meson.build +++ b/meson.build @@ -1034,6 +1034,7 @@ bpf_compiler = get_option('bpf-compiler') libbpf = dependency('libbpf', required : bpf_framework, version : bpf_compiler == 'gcc' ? '>= 1.4.0' : '>= 0.1.0') +libbpf_cflags = libbpf.partial_dependency(includes: true, compile_args: true) conf.set10('HAVE_LIBBPF', libbpf.found()) if not libbpf.found() @@ -1139,6 +1140,7 @@ if not have libpwquality = dependency('passwdqc', required : get_option('passwdqc')) endif +libpwquality_cflags = libpwquality.partial_dependency(includes: true, compile_args: true) conf.set10('HAVE_PWQUALITY', have) conf.set10('HAVE_PASSWDQC', not have and libpwquality.found()) @@ -1242,6 +1244,7 @@ endif libcryptsetup = dependency('libcryptsetup', version : libcryptsetup_plugins.enabled() ? '>= 2.4.0' : '>= 2.0.1', required : libcryptsetup) +libcryptsetup_cflags = libcryptsetup.partial_dependency(includes: true, compile_args: true) have = libcryptsetup.found() foreach ident : ['crypt_set_metadata_size', @@ -1307,12 +1310,14 @@ if not have libidn = dependency('libidn', required : get_option('libidn')) endif +libidn_cflags = libidn.partial_dependency(includes: true, compile_args: true) conf.set10('HAVE_LIBIDN', not have and libidn.found()) conf.set10('HAVE_LIBIDN2', have) libqrencode = dependency('libqrencode', version : '>= 3', required : get_option('qrencode')) +libqrencode_cflags = libqrencode.partial_dependency(includes: true, compile_args: true) conf.set10('HAVE_QRENCODE', libqrencode.found()) feature = get_option('gcrypt') @@ -1353,16 +1358,23 @@ feature = get_option('libfido2').require( error_message : 'openssl required') libfido2 = dependency('libfido2', required : feature) +libfido2_cflags = libfido2.partial_dependency(includes: true, compile_args: true) conf.set10('HAVE_LIBFIDO2', libfido2.found()) tpm2 = dependency('tss2-esys tss2-rc tss2-mu tss2-tcti-device', required : get_option('tpm2')) +tpm2_cflags = tpm2.partial_dependency(includes: true, compile_args: true) conf.set10('HAVE_TPM2', tpm2.found()) conf.set10('HAVE_TSS2_ESYS3', tpm2.found() and tpm2.version().version_compare('>= 3.0.0')) libdw = dependency('libdw', required : get_option('elfutils')) -conf.set10('HAVE_ELFUTILS', libdw.found()) +libdw_cflags = libdw.partial_dependency(includes: true, compile_args: true) +libelf = dependency('libelf', + required : get_option('elfutils')) +libelf_cflags = libelf.partial_dependency(includes: true, compile_args: true) +conf.set10('HAVE_ELFUTILS', libdw.found() and libelf.found()) + # New in elfutils 0.177 conf.set10('HAVE_DWELF_ELF_E_MACHINE_STRING', libdw.found() and cc.has_function('dwelf_elf_e_machine_string', dependencies : libdw)) @@ -1435,6 +1447,7 @@ conf.set('DEFAULT_COMPRESSION', 'COMPRESSION_@0@'.format(compression.to_upper()) libarchive = dependency('libarchive', version : '>= 3.0', required : get_option('libarchive')) +libarchive_cflags = libarchive.partial_dependency(includes: true, compile_args: true) conf.set10('HAVE_LIBARCHIVE', libarchive.found()) conf.set10('HAVE_LIBARCHIVE_UID_IS_SET', libarchive.found() and cc.has_function('archive_entry_uid_is_set', dependencies : libarchive)) @@ -1444,10 +1457,12 @@ conf.set10('HAVE_LIBARCHIVE_HARDLINK_IS_SET', libxkbcommon = dependency('xkbcommon', version : '>= 0.3.0', required : get_option('xkbcommon')) +libxkbcommon_cflags = libxkbcommon.partial_dependency(includes: true, compile_args: true) conf.set10('HAVE_XKBCOMMON', libxkbcommon.found()) libpcre2 = dependency('libpcre2-8', required : get_option('pcre2')) +libpcre2_cflags = libpcre2.partial_dependency(includes: true, compile_args: true) conf.set10('HAVE_PCRE2', libpcre2.found()) libglib = dependency('glib-2.0', diff --git a/src/basic/compress.c b/src/basic/compress.c index 40bf6d4cbe..2aca7efc08 100644 --- a/src/basic/compress.c +++ b/src/basic/compress.c @@ -51,8 +51,8 @@ DLSYM_PROTOTYPE(LZ4_decompress_safe) = NULL; DLSYM_PROTOTYPE(LZ4_decompress_safe_partial) = NULL; DLSYM_PROTOTYPE(LZ4_versionNumber) = NULL; -DEFINE_TRIVIAL_CLEANUP_FUNC_FULL(LZ4F_compressionContext_t, sym_LZ4F_freeCompressionContext, NULL); -DEFINE_TRIVIAL_CLEANUP_FUNC_FULL(LZ4F_decompressionContext_t, sym_LZ4F_freeDecompressionContext, NULL); +DEFINE_TRIVIAL_CLEANUP_FUNC_FULL_RENAME(LZ4F_compressionContext_t, sym_LZ4F_freeCompressionContext, LZ4F_freeCompressionContextp, NULL); +DEFINE_TRIVIAL_CLEANUP_FUNC_FULL_RENAME(LZ4F_decompressionContext_t, sym_LZ4F_freeDecompressionContext, LZ4F_freeDecompressionContextp, NULL); #endif #if HAVE_ZSTD @@ -75,8 +75,8 @@ static DLSYM_PROTOTYPE(ZSTD_getErrorName) = NULL; static DLSYM_PROTOTYPE(ZSTD_getFrameContentSize) = NULL; static DLSYM_PROTOTYPE(ZSTD_isError) = NULL; -DEFINE_TRIVIAL_CLEANUP_FUNC_FULL(ZSTD_CCtx*, sym_ZSTD_freeCCtx, NULL); -DEFINE_TRIVIAL_CLEANUP_FUNC_FULL(ZSTD_DCtx*, sym_ZSTD_freeDCtx, NULL); +DEFINE_TRIVIAL_CLEANUP_FUNC_FULL_RENAME(ZSTD_CCtx*, sym_ZSTD_freeCCtx, ZSTD_freeCCtxp, NULL); +DEFINE_TRIVIAL_CLEANUP_FUNC_FULL_RENAME(ZSTD_DCtx*, sym_ZSTD_freeDCtx, ZSTD_freeDCtxp, NULL); static int zstd_ret_to_errno(size_t ret) { switch (sym_ZSTD_getErrorCode(ret)) { @@ -481,7 +481,7 @@ int decompress_blob_zstd( if (!(greedy_realloc(dst, MAX(sym_ZSTD_DStreamOutSize(), size), 1))) return -ENOMEM; - _cleanup_(sym_ZSTD_freeDCtxp) ZSTD_DCtx *dctx = sym_ZSTD_createDCtx(); + _cleanup_(ZSTD_freeDCtxp) ZSTD_DCtx *dctx = sym_ZSTD_createDCtx(); if (!dctx) return -ENOMEM; @@ -701,7 +701,7 @@ int decompress_startswith_zstd( if (size < prefix_len + 1) return 0; /* Decompressed text too short to match the prefix and extra */ - _cleanup_(sym_ZSTD_freeDCtxp) ZSTD_DCtx *dctx = sym_ZSTD_createDCtx(); + _cleanup_(ZSTD_freeDCtxp) ZSTD_DCtx *dctx = sym_ZSTD_createDCtx(); if (!dctx) return -ENOMEM; @@ -858,7 +858,7 @@ int compress_stream_lz4(int fdf, int fdt, uint64_t max_bytes, uint64_t *ret_unco #if HAVE_LZ4 LZ4F_errorCode_t c; - _cleanup_(sym_LZ4F_freeCompressionContextp) LZ4F_compressionContext_t ctx = NULL; + _cleanup_(LZ4F_freeCompressionContextp) LZ4F_compressionContext_t ctx = NULL; _cleanup_free_ void *in_buff = NULL; _cleanup_free_ char *out_buff = NULL; size_t out_allocsize, n, offset = 0, frame_size; @@ -1032,7 +1032,7 @@ int decompress_stream_xz(int fdf, int fdt, uint64_t max_bytes) { int decompress_stream_lz4(int in, int out, uint64_t max_bytes) { #if HAVE_LZ4 size_t c; - _cleanup_(sym_LZ4F_freeDecompressionContextp) LZ4F_decompressionContext_t ctx = NULL; + _cleanup_(LZ4F_freeDecompressionContextp) LZ4F_decompressionContext_t ctx = NULL; _cleanup_free_ char *buf = NULL; char *src; struct stat st; @@ -1106,7 +1106,7 @@ int compress_stream_zstd(int fdf, int fdt, uint64_t max_bytes, uint64_t *ret_unc assert(fdt >= 0); #if HAVE_ZSTD - _cleanup_(sym_ZSTD_freeCCtxp) ZSTD_CCtx *cctx = NULL; + _cleanup_(ZSTD_freeCCtxp) ZSTD_CCtx *cctx = NULL; _cleanup_free_ void *in_buff = NULL, *out_buff = NULL; size_t in_allocsize, out_allocsize; size_t z; @@ -1215,7 +1215,7 @@ int decompress_stream_zstd(int fdf, int fdt, uint64_t max_bytes) { assert(fdt >= 0); #if HAVE_ZSTD - _cleanup_(sym_ZSTD_freeDCtxp) ZSTD_DCtx *dctx = NULL; + _cleanup_(ZSTD_freeDCtxp) ZSTD_DCtx *dctx = NULL; _cleanup_free_ void *in_buff = NULL, *out_buff = NULL; size_t in_allocsize, out_allocsize; size_t last_result = 0; diff --git a/src/core/apparmor-setup.c b/src/core/apparmor-setup.c index 104335a75e..c7bb9bf158 100644 --- a/src/core/apparmor-setup.c +++ b/src/core/apparmor-setup.c @@ -14,8 +14,8 @@ int mac_apparmor_setup(void) { #if HAVE_APPARMOR - _cleanup_(sym_aa_policy_cache_unrefp) aa_policy_cache *policy_cache = NULL; - _cleanup_(sym_aa_features_unrefp) aa_features *features = NULL; + _cleanup_(aa_policy_cache_unrefp) aa_policy_cache *policy_cache = NULL; + _cleanup_(aa_features_unrefp) aa_features *features = NULL; _cleanup_free_ char *current_profile = NULL, *cache_dir_path = NULL; int r; diff --git a/src/core/dbus-execute.c b/src/core/dbus-execute.c index 0157665c4a..9b7eb5d76b 100644 --- a/src/core/dbus-execute.c +++ b/src/core/dbus-execute.c @@ -2039,7 +2039,7 @@ int bus_exec_context_set_transient_property( return r; while ((r = sd_bus_message_read(message, "(bs)", &is_allowlist, &pattern)) > 0) { - _cleanup_(pattern_freep) pcre2_code *compiled_pattern = NULL; + _cleanup_(pcre2_code_freep) pcre2_code *compiled_pattern = NULL; if (isempty(pattern)) continue; diff --git a/src/core/kmod-setup.c b/src/core/kmod-setup.c index e63e4d228d..e8230d4adf 100644 --- a/src/core/kmod-setup.c +++ b/src/core/kmod-setup.c @@ -148,7 +148,7 @@ int kmod_setup(void) { if (have_effective_cap(CAP_SYS_MODULE) <= 0) return 0; - _cleanup_(sym_kmod_unrefp) struct kmod_ctx *ctx = NULL; + _cleanup_(kmod_unrefp) struct kmod_ctx *ctx = NULL; FOREACH_ELEMENT(kmod, kmod_table) { if (kmod->path && access(kmod->path, F_OK) >= 0) continue; diff --git a/src/cryptenroll/cryptenroll-pkcs11.c b/src/cryptenroll/cryptenroll-pkcs11.c index b6465b915c..656246afc0 100644 --- a/src/cryptenroll/cryptenroll-pkcs11.c +++ b/src/cryptenroll/cryptenroll-pkcs11.c @@ -10,7 +10,7 @@ #if HAVE_P11KIT && HAVE_OPENSSL static int uri_set_private_class(const char *uri, char **ret_uri) { - _cleanup_(sym_p11_kit_uri_freep) P11KitUri *p11kit_uri = NULL; + _cleanup_(p11_kit_uri_freep) P11KitUri *p11kit_uri = NULL; _cleanup_free_ char *private_uri = NULL; int r; diff --git a/src/dissect/dissect.c b/src/dissect/dissect.c index ca69b36c22..51b2ac40bc 100644 --- a/src/dissect/dissect.c +++ b/src/dissect/dissect.c @@ -1455,7 +1455,7 @@ static int archive_item( log_debug("Archiving %s\n", path); - _cleanup_(sym_archive_entry_freep) struct archive_entry *entry = NULL; + _cleanup_(archive_entry_freep) struct archive_entry *entry = NULL; entry = sym_archive_entry_new(); if (!entry) return log_oom(); @@ -1744,7 +1744,7 @@ static int action_list_or_mtree_or_copy_or_make_archive(DissectedImage *m, LoopD if (dfd < 0) return log_error_errno(errno, "Failed to open mount directory: %m"); - _cleanup_(sym_archive_write_freep) struct archive *a = sym_archive_write_new(); + _cleanup_(archive_write_freep) struct archive *a = sym_archive_write_new(); if (!a) return log_oom(); diff --git a/src/fundamental/cleanup-fundamental.h b/src/fundamental/cleanup-fundamental.h index 8a8c40ad06..86b9851fd5 100644 --- a/src/fundamental/cleanup-fundamental.h +++ b/src/fundamental/cleanup-fundamental.h @@ -34,14 +34,17 @@ DEFINE_TRIVIAL_CLEANUP_FUNC_FULL_RENAME(type, func, func##p, empty) /* When func() doesn't return the appropriate type, and is also a macro, set variable to empty afterwards. */ -#define DEFINE_TRIVIAL_CLEANUP_FUNC_FULL_MACRO(type, func, empty) \ - static inline void func##p(type *p) { \ +#define DEFINE_TRIVIAL_CLEANUP_FUNC_FULL_MACRO_RENAME(type, macro, name, empty) \ + static inline void name(type *p) { \ if (*p != (empty)) { \ - func(*p); \ + macro(*p); \ *p = (empty); \ } \ } +#define DEFINE_TRIVIAL_CLEANUP_FUNC_FULL_MACRO(type, macro, empty) \ + DEFINE_TRIVIAL_CLEANUP_FUNC_FULL_MACRO_RENAME(type, macro, macro##p, empty) + typedef void (*free_array_func_t)(void *p, size_t n); /* An automatic _cleanup_-like logic for destroy arrays (i.e. pointers + size) when leaving scope */ diff --git a/src/journal/journalctl.c b/src/journal/journalctl.c index 8c5fd2aed2..95b6cf20da 100644 --- a/src/journal/journalctl.c +++ b/src/journal/journalctl.c @@ -126,7 +126,7 @@ STATIC_DESTRUCTOR_REGISTER(arg_machine, freep); STATIC_DESTRUCTOR_REGISTER(arg_namespace, freep); STATIC_DESTRUCTOR_REGISTER(arg_output_fields, set_freep); STATIC_DESTRUCTOR_REGISTER(arg_pattern, freep); -STATIC_DESTRUCTOR_REGISTER(arg_compiled_pattern, pattern_freep); +STATIC_DESTRUCTOR_REGISTER(arg_compiled_pattern, pcre2_code_freep); STATIC_DESTRUCTOR_REGISTER(arg_image_policy, image_policy_freep); static int parse_id_descriptor(const char *x, sd_id128_t *ret_id, int *ret_offset) { diff --git a/src/journal/journald-client.c b/src/journal/journald-client.c index 6641c09336..b23f7e3b20 100644 --- a/src/journal/journald-client.c +++ b/src/journal/journald-client.c @@ -33,7 +33,7 @@ static int client_parse_log_filter_nulstr(const char *nulstr, size_t len, Set ** return log_oom_debug(); STRV_FOREACH(pattern, patterns_strv) { - _cleanup_(pattern_freep) pcre2_code *compiled_pattern = NULL; + _cleanup_(pcre2_code_freep) pcre2_code *compiled_pattern = NULL; r = pattern_compile_and_log(*pattern, 0, &compiled_pattern); if (r < 0) diff --git a/src/locale/meson.build b/src/locale/meson.build index c417591680..2994080d1f 100644 --- a/src/locale/meson.build +++ b/src/locale/meson.build @@ -19,7 +19,7 @@ localectl_sources = files('localectl.c') if conf.get('HAVE_XKBCOMMON') == 1 libxkbcommon_deps = [ libdl, - libxkbcommon.partial_dependency(compile_args: true), + libxkbcommon_cflags, ] else libxkbcommon_deps = [] diff --git a/src/locale/xkbcommon-util.c b/src/locale/xkbcommon-util.c index edced7492d..2334587e88 100644 --- a/src/locale/xkbcommon-util.c +++ b/src/locale/xkbcommon-util.c @@ -38,12 +38,12 @@ static void log_xkb(struct xkb_context *ctx, enum xkb_log_level lvl, const char REENABLE_WARNING; } -DEFINE_TRIVIAL_CLEANUP_FUNC_FULL(struct xkb_context *, sym_xkb_context_unref, NULL); -DEFINE_TRIVIAL_CLEANUP_FUNC_FULL(struct xkb_keymap *, sym_xkb_keymap_unref, NULL); +DEFINE_TRIVIAL_CLEANUP_FUNC_FULL_RENAME(struct xkb_context *, sym_xkb_context_unref, xkb_context_unrefp, NULL); +DEFINE_TRIVIAL_CLEANUP_FUNC_FULL_RENAME(struct xkb_keymap *, sym_xkb_keymap_unref, xkb_keymap_unrefp, NULL); int verify_xkb_rmlvo(const char *model, const char *layout, const char *variant, const char *options) { - _cleanup_(sym_xkb_context_unrefp) struct xkb_context *ctx = NULL; - _cleanup_(sym_xkb_keymap_unrefp) struct xkb_keymap *km = NULL; + _cleanup_(xkb_context_unrefp) struct xkb_context *ctx = NULL; + _cleanup_(xkb_keymap_unrefp) struct xkb_keymap *km = NULL; const struct xkb_rule_names rmlvo = { .model = model, .layout = layout, diff --git a/src/modules-load/modules-load.c b/src/modules-load/modules-load.c index ea1b717bb3..e65da475c3 100644 --- a/src/modules-load/modules-load.c +++ b/src/modules-load/modules-load.c @@ -135,7 +135,7 @@ static int parse_argv(int argc, char *argv[]) { } static int run(int argc, char *argv[]) { - _cleanup_(sym_kmod_unrefp) struct kmod_ctx *ctx = NULL; + _cleanup_(kmod_unrefp) struct kmod_ctx *ctx = NULL; int r, k; r = parse_argv(argc, argv); diff --git a/src/shared/apparmor-util.h b/src/shared/apparmor-util.h index 52f8f7834c..c3f97ceaaf 100644 --- a/src/shared/apparmor-util.h +++ b/src/shared/apparmor-util.h @@ -17,8 +17,8 @@ extern DLSYM_PROTOTYPE(aa_policy_cache_new); extern DLSYM_PROTOTYPE(aa_policy_cache_replace_all); extern DLSYM_PROTOTYPE(aa_policy_cache_unref); -DEFINE_TRIVIAL_CLEANUP_FUNC_FULL(aa_features*, sym_aa_features_unref, NULL); -DEFINE_TRIVIAL_CLEANUP_FUNC_FULL(aa_policy_cache*, sym_aa_policy_cache_unref, NULL); +DEFINE_TRIVIAL_CLEANUP_FUNC_FULL_RENAME(aa_features*, sym_aa_features_unref, aa_features_unrefp, NULL); +DEFINE_TRIVIAL_CLEANUP_FUNC_FULL_RENAME(aa_policy_cache*, sym_aa_policy_cache_unref, aa_policy_cache_unrefp, NULL); int dlopen_libapparmor(void); #else diff --git a/src/shared/elf-util.c b/src/shared/elf-util.c index 78f8af5b07..9315562bba 100644 --- a/src/shared/elf-util.c +++ b/src/shared/elf-util.c @@ -205,7 +205,7 @@ static void stack_context_done(StackContext *c) { } } -DEFINE_TRIVIAL_CLEANUP_FUNC_FULL(Elf *, sym_elf_end, NULL); +DEFINE_TRIVIAL_CLEANUP_FUNC_FULL_RENAME(Elf *, sym_elf_end, elf_endp, NULL); static int frame_callback(Dwfl_Frame *frame, void *userdata) { StackContext *c = ASSERT_PTR(userdata); @@ -587,7 +587,7 @@ static int module_callback(Dwfl_Module *mod, void **userdata, const char *name, if (!data) continue; - _cleanup_(sym_elf_endp) Elf *memelf = sym_elf_memory(data->d_buf, data->d_size); + _cleanup_(elf_endp) Elf *memelf = sym_elf_memory(data->d_buf, data->d_size); if (!memelf) continue; r = parse_package_metadata(name, id_json, memelf, NULL, c); diff --git a/src/shared/libarchive-util.h b/src/shared/libarchive-util.h index 7d4ba3b6ba..83ee19d27a 100644 --- a/src/shared/libarchive-util.h +++ b/src/shared/libarchive-util.h @@ -77,9 +77,9 @@ static inline int sym_archive_entry_hardlink_is_set(struct archive_entry *e) { int dlopen_libarchive(void); -DEFINE_TRIVIAL_CLEANUP_FUNC_FULL(struct archive_entry*, sym_archive_entry_free, NULL); -DEFINE_TRIVIAL_CLEANUP_FUNC_FULL(struct archive*, sym_archive_write_free, NULL); -DEFINE_TRIVIAL_CLEANUP_FUNC_FULL(struct archive*, sym_archive_read_free, NULL); +DEFINE_TRIVIAL_CLEANUP_FUNC_FULL_RENAME(struct archive_entry*, sym_archive_entry_free, archive_entry_freep, NULL); +DEFINE_TRIVIAL_CLEANUP_FUNC_FULL_RENAME(struct archive*, sym_archive_write_free, archive_write_freep, NULL); +DEFINE_TRIVIAL_CLEANUP_FUNC_FULL_RENAME(struct archive*, sym_archive_read_free, archive_read_freep, NULL); #else diff --git a/src/shared/meson.build b/src/shared/meson.build index 09dd6ded0f..bc927e4cca 100644 --- a/src/shared/meson.build +++ b/src/shared/meson.build @@ -359,23 +359,34 @@ libshared_name = 'systemd-shared-@0@'.format(shared_lib_tag) libshared_deps = [threads, libacl_cflags, + libapparmor_cflags, + libarchive_cflags, libaudit_cflags, libblkid_cflags, + libbpf_cflags, libcrypt, + libcryptsetup_cflags, libdl, + libdw_cflags, + libelf_cflags, + libfido2_cflags, libgcrypt_cflags, + libidn_cflags, libkmod_cflags, - liblz4_cflags, libmount_cflags, libopenssl, libp11kit_cflags, libpam_cflags, + libpcre2_cflags, + libpwquality_cflags, + libqrencode_cflags, librt, libseccomp_cflags, libselinux_cflags, libxenctrl_cflags, libxz_cflags, - libzstd_cflags] + libzstd_cflags, + tpm2_cflags] libshared_sym_path = meson.current_source_dir() / 'libshared.sym' libshared_build_dir = meson.current_build_dir() diff --git a/src/shared/module-util.c b/src/shared/module-util.c index dcdc122ffb..25367c4da6 100644 --- a/src/shared/module-util.c +++ b/src/shared/module-util.c @@ -68,7 +68,7 @@ static int parse_proc_cmdline_item(const char *key, const char *value, void *dat } int module_load_and_warn(struct kmod_ctx *ctx, const char *module, bool verbose) { - _cleanup_(sym_kmod_module_unref_listp) struct kmod_list *modlist = NULL; + _cleanup_(kmod_module_unref_listp) struct kmod_list *modlist = NULL; _cleanup_strv_free_ char **denylist = NULL; bool denylist_parsed = false; struct kmod_list *itr; @@ -93,7 +93,7 @@ int module_load_and_warn(struct kmod_ctx *ctx, const char *module, bool verbose) "Failed to find module '%s'", module); sym_kmod_list_foreach(itr, modlist) { - _cleanup_(sym_kmod_module_unrefp) struct kmod_module *mod = NULL; + _cleanup_(kmod_module_unrefp) struct kmod_module *mod = NULL; int state, err; mod = sym_kmod_module_get_module(itr); @@ -172,7 +172,7 @@ _printf_(6,0) static void systemd_kmod_log( } int module_setup_context(struct kmod_ctx **ret) { - _cleanup_(sym_kmod_unrefp) struct kmod_ctx *ctx = NULL; + _cleanup_(kmod_unrefp) struct kmod_ctx *ctx = NULL; int r; assert(ret); diff --git a/src/shared/module-util.h b/src/shared/module-util.h index 55c81612c3..f5eaf35c90 100644 --- a/src/shared/module-util.h +++ b/src/shared/module-util.h @@ -25,9 +25,9 @@ extern DLSYM_PROTOTYPE(kmod_validate_resources); int dlopen_libkmod(void); -DEFINE_TRIVIAL_CLEANUP_FUNC(struct kmod_ctx*, sym_kmod_unref); -DEFINE_TRIVIAL_CLEANUP_FUNC(struct kmod_module*, sym_kmod_module_unref); -DEFINE_TRIVIAL_CLEANUP_FUNC_FULL(struct kmod_list*, sym_kmod_module_unref_list, NULL); +DEFINE_TRIVIAL_CLEANUP_FUNC_FULL_RENAME(struct kmod_ctx*, sym_kmod_unref, kmod_unrefp, NULL); +DEFINE_TRIVIAL_CLEANUP_FUNC_FULL_RENAME(struct kmod_module*, sym_kmod_module_unref, kmod_module_unrefp, NULL); +DEFINE_TRIVIAL_CLEANUP_FUNC_FULL_RENAME(struct kmod_list*, sym_kmod_module_unref_list, kmod_module_unref_listp, NULL); #define sym_kmod_list_foreach(list_entry, first_entry) \ for (list_entry = first_entry; \ diff --git a/src/shared/openssl-util.c b/src/shared/openssl-util.c index 8bc6c5c2d6..bb45cf73f6 100644 --- a/src/shared/openssl-util.c +++ b/src/shared/openssl-util.c @@ -871,9 +871,8 @@ int ecc_pkey_from_curve_x_y( TAKE_PTR(eckey); #endif - *ret = TAKE_PTR(pkey); - - return 0; + *ret = TAKE_PTR(pkey); + return 0; } int ecc_pkey_to_curve_x_y( diff --git a/src/shared/openssl-util.h b/src/shared/openssl-util.h index 0cead42367..0084d62fe0 100644 --- a/src/shared/openssl-util.h +++ b/src/shared/openssl-util.h @@ -190,16 +190,6 @@ static inline void* EVP_PKEY_free(EVP_PKEY *p) { return NULL; } -static inline void* ASN1_TYPE_free(ASN1_TYPE *p) { - assert(p == NULL); - return NULL; -} - -static inline void* ASN1_STRING_free(ASN1_STRING *p) { - assert(p == NULL); - return NULL; -} - static inline int string_hashsum(const char *s, size_t len, const char *md_algorithm, char **ret) { return -EOPNOTSUPP; } @@ -208,8 +198,6 @@ static inline int string_hashsum(const char *s, size_t len, const char *md_algor DEFINE_TRIVIAL_CLEANUP_FUNC_FULL(X509*, X509_free, NULL); DEFINE_TRIVIAL_CLEANUP_FUNC_FULL(EVP_PKEY*, EVP_PKEY_free, NULL); -DEFINE_TRIVIAL_CLEANUP_FUNC_FULL(ASN1_TYPE*, ASN1_TYPE_free, NULL); -DEFINE_TRIVIAL_CLEANUP_FUNC_FULL(ASN1_STRING*, ASN1_STRING_free, NULL); struct OpenSSLAskPasswordUI { AskPasswordRequest request; diff --git a/src/shared/password-quality-util-passwdqc.c b/src/shared/password-quality-util-passwdqc.c index 844068a4d6..a161f5c8b0 100644 --- a/src/shared/password-quality-util-passwdqc.c +++ b/src/shared/password-quality-util-passwdqc.c @@ -19,9 +19,11 @@ DLSYM_PROTOTYPE(passwdqc_params_free) = NULL; DLSYM_PROTOTYPE(passwdqc_check) = NULL; DLSYM_PROTOTYPE(passwdqc_random) = NULL; +DEFINE_TRIVIAL_CLEANUP_FUNC_FULL_RENAME(passwdqc_params_t*, sym_passwdqc_params_free, passwdqc_params_freep, NULL); + static int pwqc_allocate_context(passwdqc_params_t **ret) { - _cleanup_(sym_passwdqc_params_freep) passwdqc_params_t *params = NULL; + _cleanup_(passwdqc_params_freep) passwdqc_params_t *params = NULL; _cleanup_free_ char *load_reason = NULL; int r; @@ -50,7 +52,7 @@ static int pwqc_allocate_context(passwdqc_params_t **ret) { int suggest_passwords(void) { - _cleanup_(sym_passwdqc_params_freep) passwdqc_params_t *params = NULL; + _cleanup_(passwdqc_params_freep) passwdqc_params_t *params = NULL; _cleanup_strv_free_erase_ char **suggestions = NULL; _cleanup_(erase_and_freep) char *joined = NULL; int r; @@ -86,7 +88,7 @@ int check_password_quality( const char *username, char **ret_error) { - _cleanup_(sym_passwdqc_params_freep) passwdqc_params_t *params = NULL; + _cleanup_(passwdqc_params_freep) passwdqc_params_t *params = NULL; const char *check_reason; int r; diff --git a/src/shared/password-quality-util-passwdqc.h b/src/shared/password-quality-util-passwdqc.h index 1a0dd68e3d..7e94df4318 100644 --- a/src/shared/password-quality-util-passwdqc.h +++ b/src/shared/password-quality-util-passwdqc.h @@ -6,20 +6,8 @@ #if HAVE_PASSWDQC #include -#include "dlfcn-util.h" - -extern DLSYM_PROTOTYPE(passwdqc_params_reset); -extern DLSYM_PROTOTYPE(passwdqc_params_load); -extern DLSYM_PROTOTYPE(passwdqc_params_parse); -extern DLSYM_PROTOTYPE(passwdqc_params_free); -extern DLSYM_PROTOTYPE(passwdqc_check); -extern DLSYM_PROTOTYPE(passwdqc_random); - -DEFINE_TRIVIAL_CLEANUP_FUNC_FULL(passwdqc_params_t*, sym_passwdqc_params_free, NULL); - int suggest_passwords(void); int check_password_quality(const char *password, const char *old, const char *username, char **ret_error); - #endif int dlopen_passwdqc(void); diff --git a/src/shared/password-quality-util-pwquality.c b/src/shared/password-quality-util-pwquality.c index 49ea7d2fe2..dfb618a4ba 100644 --- a/src/shared/password-quality-util-pwquality.c +++ b/src/shared/password-quality-util-pwquality.c @@ -25,6 +25,8 @@ DLSYM_PROTOTYPE(pwquality_read_config) = NULL; DLSYM_PROTOTYPE(pwquality_set_int_value) = NULL; DLSYM_PROTOTYPE(pwquality_strerror) = NULL; +DEFINE_TRIVIAL_CLEANUP_FUNC_FULL_RENAME(pwquality_settings_t*, sym_pwquality_free_settings, pwquality_free_settingsp, NULL); + static void pwq_maybe_disable_dictionary(pwquality_settings_t *pwq) { char buf[PWQ_MAX_ERROR_MESSAGE_LEN]; const char *path; @@ -59,7 +61,7 @@ static void pwq_maybe_disable_dictionary(pwquality_settings_t *pwq) { } static int pwq_allocate_context(pwquality_settings_t **ret) { - _cleanup_(sym_pwquality_free_settingsp) pwquality_settings_t *pwq = NULL; + _cleanup_(pwquality_free_settingsp) pwquality_settings_t *pwq = NULL; char buf[PWQ_MAX_ERROR_MESSAGE_LEN]; void *auxerror; int r; @@ -86,7 +88,7 @@ static int pwq_allocate_context(pwquality_settings_t **ret) { } int suggest_passwords(void) { - _cleanup_(sym_pwquality_free_settingsp) pwquality_settings_t *pwq = NULL; + _cleanup_(pwquality_free_settingsp) pwquality_settings_t *pwq = NULL; _cleanup_strv_free_erase_ char **suggestions = NULL; _cleanup_(erase_and_freep) char *joined = NULL; char buf[PWQ_MAX_ERROR_MESSAGE_LEN]; @@ -119,7 +121,7 @@ int suggest_passwords(void) { } int check_password_quality(const char *password, const char *old, const char *username, char **ret_error) { - _cleanup_(sym_pwquality_free_settingsp) pwquality_settings_t *pwq = NULL; + _cleanup_(pwquality_free_settingsp) pwquality_settings_t *pwq = NULL; char buf[PWQ_MAX_ERROR_MESSAGE_LEN]; void *auxerror; int r; diff --git a/src/shared/password-quality-util-pwquality.h b/src/shared/password-quality-util-pwquality.h index 6ef4088716..aaede45c2f 100644 --- a/src/shared/password-quality-util-pwquality.h +++ b/src/shared/password-quality-util-pwquality.h @@ -6,22 +6,8 @@ #if HAVE_PWQUALITY #include -#include "dlfcn-util.h" - -extern DLSYM_PROTOTYPE(pwquality_check); -extern DLSYM_PROTOTYPE(pwquality_default_settings); -extern DLSYM_PROTOTYPE(pwquality_free_settings); -extern DLSYM_PROTOTYPE(pwquality_generate); -extern DLSYM_PROTOTYPE(pwquality_get_str_value); -extern DLSYM_PROTOTYPE(pwquality_read_config); -extern DLSYM_PROTOTYPE(pwquality_set_int_value); -extern DLSYM_PROTOTYPE(pwquality_strerror); - -DEFINE_TRIVIAL_CLEANUP_FUNC_FULL(pwquality_settings_t*, sym_pwquality_free_settings, NULL); - int suggest_passwords(void); int check_password_quality(const char *password, const char *old, const char *username, char **ret_error); - #endif int dlopen_pwquality(void); diff --git a/src/shared/pcre2-util.c b/src/shared/pcre2-util.c index 7a80ddd9fa..10a767442a 100644 --- a/src/shared/pcre2-util.c +++ b/src/shared/pcre2-util.c @@ -58,7 +58,7 @@ int dlopen_pcre2(void) { int pattern_compile_and_log(const char *pattern, PatternCompileCase case_, pcre2_code **ret) { #if HAVE_PCRE2 PCRE2_SIZE erroroffset; - _cleanup_(sym_pcre2_code_freep) pcre2_code *p = NULL; + _cleanup_(pcre2_code_freep) pcre2_code *p = NULL; unsigned flags = 0; int errorcode, r; @@ -71,9 +71,9 @@ int pattern_compile_and_log(const char *pattern, PatternCompileCase case_, pcre2 if (case_ == PATTERN_COMPILE_CASE_INSENSITIVE) flags = PCRE2_CASELESS; else if (case_ == PATTERN_COMPILE_CASE_AUTO) { - _cleanup_(sym_pcre2_match_data_freep) pcre2_match_data *md = NULL; + _cleanup_(pcre2_match_data_freep) pcre2_match_data *md = NULL; bool has_case; - _cleanup_(sym_pcre2_code_freep) pcre2_code *cs = NULL; + _cleanup_(pcre2_code_freep) pcre2_code *cs = NULL; md = sym_pcre2_match_data_create(1, NULL); if (!md) @@ -116,7 +116,7 @@ int pattern_compile_and_log(const char *pattern, PatternCompileCase case_, pcre2 int pattern_matches_and_log(pcre2_code *compiled_pattern, const char *message, size_t size, size_t *ret_ovec) { #if HAVE_PCRE2 - _cleanup_(sym_pcre2_match_data_freep) pcre2_match_data *md = NULL; + _cleanup_(pcre2_match_data_freep) pcre2_match_data *md = NULL; int r; assert(compiled_pattern); @@ -156,17 +156,3 @@ int pattern_matches_and_log(pcre2_code *compiled_pattern, const char *message, s return log_error_errno(SYNTHETIC_ERRNO(EOPNOTSUPP), "PCRE2 support is not compiled in."); #endif } - -void *pattern_free(pcre2_code *p) { -#if HAVE_PCRE2 - if (!p) - return NULL; - - assert(pcre2_dl); - sym_pcre2_code_free(p); - return NULL; -#else - assert(p == NULL); - return NULL; -#endif -} diff --git a/src/shared/pcre2-util.h b/src/shared/pcre2-util.h index aa9b77dc19..8c85c61994 100644 --- a/src/shared/pcre2-util.h +++ b/src/shared/pcre2-util.h @@ -18,14 +18,19 @@ extern DLSYM_PROTOTYPE(pcre2_get_error_message); extern DLSYM_PROTOTYPE(pcre2_match); extern DLSYM_PROTOTYPE(pcre2_get_ovector_pointer); -DEFINE_TRIVIAL_CLEANUP_FUNC_FULL(pcre2_match_data*, sym_pcre2_match_data_free, NULL); -DEFINE_TRIVIAL_CLEANUP_FUNC_FULL(pcre2_code*, sym_pcre2_code_free, NULL); +DEFINE_TRIVIAL_CLEANUP_FUNC_FULL_RENAME(pcre2_match_data*, sym_pcre2_match_data_free, pcre2_match_data_freep, NULL); #else -typedef struct {} pcre2_code; +typedef struct pcre2_code pcre2_code; + +static inline void sym_pcre2_code_free(pcre2_code *p) { + assert(!p); +} #endif +DEFINE_TRIVIAL_CLEANUP_FUNC_FULL_RENAME(pcre2_code*, sym_pcre2_code_free, pcre2_code_freep, NULL); + extern const struct hash_ops pcre2_code_hash_ops_free; typedef enum PatternCompileCase { @@ -38,8 +43,5 @@ typedef enum PatternCompileCase { int pattern_compile_and_log(const char *pattern, PatternCompileCase case_, pcre2_code **ret); int pattern_matches_and_log(pcre2_code *compiled_pattern, const char *message, size_t size, size_t *ret_ovec); -void *pattern_free(pcre2_code *p); - -DEFINE_TRIVIAL_CLEANUP_FUNC(pcre2_code*, pattern_free); int dlopen_pcre2(void); diff --git a/src/shared/pkcs11-util.c b/src/shared/pkcs11-util.c index 2c32f6bb20..1b8051a1ab 100644 --- a/src/shared/pkcs11-util.c +++ b/src/shared/pkcs11-util.c @@ -57,7 +57,7 @@ DLSYM_PROTOTYPE(p11_kit_uri_new) = NULL; DLSYM_PROTOTYPE(p11_kit_uri_parse) = NULL; int uri_from_string(const char *p, P11KitUri **ret) { - _cleanup_(sym_p11_kit_uri_freep) P11KitUri *uri = NULL; + _cleanup_(p11_kit_uri_freep) P11KitUri *uri = NULL; int r; assert(p); @@ -273,7 +273,7 @@ int pkcs11_token_login( char **ret_used_pin) { _cleanup_free_ char *token_uri_string = NULL, *token_uri_escaped = NULL, *id = NULL, *token_label = NULL; - _cleanup_(sym_p11_kit_uri_freep) P11KitUri *token_uri = NULL; + _cleanup_(p11_kit_uri_freep) P11KitUri *token_uri = NULL; CK_TOKEN_INFO updated_token_info; int uri_result, r; CK_RV rv; @@ -1331,7 +1331,7 @@ static int slot_process( pkcs11_find_token_callback_t callback, void *userdata) { - _cleanup_(sym_p11_kit_uri_freep) P11KitUri* slot_uri = NULL, *token_uri = NULL; + _cleanup_(p11_kit_uri_freep) P11KitUri* slot_uri = NULL, *token_uri = NULL; _cleanup_free_ char *token_uri_string = NULL; CK_TOKEN_INFO token_info; CK_SLOT_INFO slot_info; @@ -1411,7 +1411,7 @@ static int module_process( pkcs11_find_token_callback_t callback, void *userdata) { - _cleanup_(sym_p11_kit_uri_freep) P11KitUri* module_uri = NULL; + _cleanup_(p11_kit_uri_freep) P11KitUri* module_uri = NULL; _cleanup_free_ char *name = NULL, *module_uri_string = NULL; _cleanup_free_ CK_SLOT_ID *slotids = NULL; CK_ULONG n_slotids = 0; @@ -1483,8 +1483,8 @@ int pkcs11_find_token( pkcs11_find_token_callback_t callback, void *userdata) { - _cleanup_(sym_p11_kit_modules_finalize_and_releasep) CK_FUNCTION_LIST **modules = NULL; - _cleanup_(sym_p11_kit_uri_freep) P11KitUri *search_uri = NULL; + _cleanup_(p11_kit_modules_finalize_and_releasep) CK_FUNCTION_LIST **modules = NULL; + _cleanup_(p11_kit_uri_freep) P11KitUri *search_uri = NULL; int r; r = dlopen_p11kit(); @@ -1739,7 +1739,7 @@ static int list_callback( void *userdata) { _cleanup_free_ char *token_uri_string = NULL, *token_label = NULL, *token_manufacturer_id = NULL, *token_model = NULL; - _cleanup_(sym_p11_kit_uri_freep) P11KitUri *token_uri = NULL; + _cleanup_(p11_kit_uri_freep) P11KitUri *token_uri = NULL; Table *t = userdata; int uri_result, r; @@ -1860,7 +1860,7 @@ static int auto_callback( P11KitUri *uri, void *userdata) { - _cleanup_(sym_p11_kit_uri_freep) P11KitUri *token_uri = NULL; + _cleanup_(p11_kit_uri_freep) P11KitUri *token_uri = NULL; char **t = userdata; int uri_result, r; diff --git a/src/shared/pkcs11-util.h b/src/shared/pkcs11-util.h index 2b0aaa974c..6f04245479 100644 --- a/src/shared/pkcs11-util.h +++ b/src/shared/pkcs11-util.h @@ -40,8 +40,8 @@ P11KitUri *uri_from_module_info(const CK_INFO *info); P11KitUri *uri_from_slot_info(const CK_SLOT_INFO *slot_info); P11KitUri *uri_from_token_info(const CK_TOKEN_INFO *token_info); -DEFINE_TRIVIAL_CLEANUP_FUNC_FULL(P11KitUri*, sym_p11_kit_uri_free, NULL); -DEFINE_TRIVIAL_CLEANUP_FUNC_FULL(CK_FUNCTION_LIST**, sym_p11_kit_modules_finalize_and_release, NULL); +DEFINE_TRIVIAL_CLEANUP_FUNC_FULL_RENAME(P11KitUri*, sym_p11_kit_uri_free, p11_kit_uri_freep, NULL); +DEFINE_TRIVIAL_CLEANUP_FUNC_FULL_RENAME(CK_FUNCTION_LIST**, sym_p11_kit_modules_finalize_and_release, p11_kit_modules_finalize_and_releasep, NULL); CK_RV pkcs11_get_slot_list_malloc(CK_FUNCTION_LIST *m, CK_SLOT_ID **ret_slotids, CK_ULONG *ret_n_slotids); diff --git a/src/shared/qrcode-util.c b/src/shared/qrcode-util.c index 43ef871e74..320b2353ff 100644 --- a/src/shared/qrcode-util.c +++ b/src/shared/qrcode-util.c @@ -183,7 +183,7 @@ static void write_qrcode(FILE *output, QRcode *qr, unsigned row, unsigned column fflush(output); } -DEFINE_TRIVIAL_CLEANUP_FUNC_FULL(QRcode*, sym_QRcode_free, NULL); +DEFINE_TRIVIAL_CLEANUP_FUNC_FULL_RENAME(QRcode*, sym_QRcode_free, QRcode_freep, NULL); #endif @@ -211,8 +211,7 @@ int print_qrcode_full( if (r < 0) return r; - _cleanup_(sym_QRcode_freep) QRcode *qr = - sym_QRcode_encodeString(string, 0, QR_ECLEVEL_L, QR_MODE_8, 1); + _cleanup_(QRcode_freep) QRcode *qr = sym_QRcode_encodeString(string, 0, QR_ECLEVEL_L, QR_MODE_8, 1); if (!qr) return log_oom_debug(); diff --git a/src/shared/tar-util.c b/src/shared/tar-util.c index 6eb3a2baad..135ff28a11 100644 --- a/src/shared/tar-util.c +++ b/src/shared/tar-util.c @@ -392,7 +392,7 @@ int tar_x(int input_fd, int tree_fd, TarFlags flags) { assert(input_fd >= 0); assert(tree_fd >= 0); - _cleanup_(sym_archive_read_freep) struct archive *a = NULL; + _cleanup_(archive_read_freep) struct archive *a = NULL; a = sym_archive_read_new(); if (!a) return log_oom(); diff --git a/src/test/test-dlopen-so.c b/src/test/test-dlopen-so.c index 66efbb0cf7..c3a76d9f9f 100644 --- a/src/test/test-dlopen-so.c +++ b/src/test/test-dlopen-so.c @@ -36,32 +36,32 @@ static int run(int argc, char **argv) { * where .so versions change and distributions update, but systemd doesn't have the new so names * around yet. */ - ASSERT_DLOPEN(dlopen_idn, HAVE_LIBIDN2 || HAVE_LIBIDN); + ASSERT_DLOPEN(dlopen_bpf, HAVE_LIBBPF); ASSERT_DLOPEN(dlopen_cryptsetup, HAVE_LIBCRYPTSETUP); + ASSERT_DLOPEN(dlopen_dw, HAVE_ELFUTILS); + ASSERT_DLOPEN(dlopen_elf, HAVE_ELFUTILS); + ASSERT_DLOPEN(dlopen_gcrypt, HAVE_GCRYPT); + ASSERT_DLOPEN(dlopen_idn, HAVE_LIBIDN2 || HAVE_LIBIDN); + ASSERT_DLOPEN(dlopen_libacl, HAVE_ACL); + ASSERT_DLOPEN(dlopen_libapparmor, HAVE_APPARMOR); + ASSERT_DLOPEN(dlopen_libarchive, HAVE_LIBARCHIVE); + ASSERT_DLOPEN(dlopen_libaudit, HAVE_AUDIT); + ASSERT_DLOPEN(dlopen_libblkid, HAVE_BLKID); + ASSERT_DLOPEN(dlopen_libfido2, HAVE_LIBFIDO2); + ASSERT_DLOPEN(dlopen_libkmod, HAVE_KMOD); + ASSERT_DLOPEN(dlopen_libmount, true); + ASSERT_DLOPEN(dlopen_libpam, HAVE_PAM); + ASSERT_DLOPEN(dlopen_libseccomp, HAVE_SECCOMP); + ASSERT_DLOPEN(dlopen_libselinux, HAVE_SELINUX); + ASSERT_DLOPEN(dlopen_lz4, HAVE_LZ4); + ASSERT_DLOPEN(dlopen_lzma, HAVE_XZ); + ASSERT_DLOPEN(dlopen_p11kit, HAVE_P11KIT); ASSERT_DLOPEN(dlopen_passwdqc, HAVE_PASSWDQC); + ASSERT_DLOPEN(dlopen_pcre2, HAVE_PCRE2); ASSERT_DLOPEN(dlopen_pwquality, HAVE_PWQUALITY); ASSERT_DLOPEN(dlopen_qrencode, HAVE_QRENCODE); ASSERT_DLOPEN(dlopen_tpm2, HAVE_TPM2); - ASSERT_DLOPEN(dlopen_libfido2, HAVE_LIBFIDO2); - ASSERT_DLOPEN(dlopen_bpf, HAVE_LIBBPF); - ASSERT_DLOPEN(dlopen_dw, HAVE_ELFUTILS); - ASSERT_DLOPEN(dlopen_elf, HAVE_ELFUTILS); - ASSERT_DLOPEN(dlopen_pcre2, HAVE_PCRE2); - ASSERT_DLOPEN(dlopen_p11kit, HAVE_P11KIT); - ASSERT_DLOPEN(dlopen_libarchive, HAVE_LIBARCHIVE); - ASSERT_DLOPEN(dlopen_lz4, HAVE_LZ4); ASSERT_DLOPEN(dlopen_zstd, HAVE_ZSTD); - ASSERT_DLOPEN(dlopen_lzma, HAVE_XZ); - ASSERT_DLOPEN(dlopen_gcrypt, HAVE_GCRYPT); - ASSERT_DLOPEN(dlopen_libkmod, HAVE_KMOD); - ASSERT_DLOPEN(dlopen_libapparmor, HAVE_APPARMOR); - ASSERT_DLOPEN(dlopen_libaudit, HAVE_AUDIT); - ASSERT_DLOPEN(dlopen_libpam, HAVE_PAM); - ASSERT_DLOPEN(dlopen_libacl, HAVE_ACL); - ASSERT_DLOPEN(dlopen_libblkid, HAVE_BLKID); - ASSERT_DLOPEN(dlopen_libseccomp, HAVE_SECCOMP); - ASSERT_DLOPEN(dlopen_libmount, true); - ASSERT_DLOPEN(dlopen_libselinux, HAVE_SELINUX); return 0; } diff --git a/src/test/test-netlink-manual.c b/src/test/test-netlink-manual.c index 02ef02be97..7934aa879d 100644 --- a/src/test/test-netlink-manual.c +++ b/src/test/test-netlink-manual.c @@ -10,8 +10,8 @@ #include "tests.h" static int load_module(const char *mod_name) { - _cleanup_(sym_kmod_unrefp) struct kmod_ctx *ctx = NULL; - _cleanup_(sym_kmod_module_unref_listp) struct kmod_list *list = NULL; + _cleanup_(kmod_unrefp) struct kmod_ctx *ctx = NULL; + _cleanup_(kmod_module_unref_listp) struct kmod_list *list = NULL; struct kmod_list *l; int r; @@ -28,7 +28,7 @@ static int load_module(const char *mod_name) { return r; sym_kmod_list_foreach(l, list) { - _cleanup_(sym_kmod_module_unrefp) struct kmod_module *mod = NULL; + _cleanup_(kmod_module_unrefp) struct kmod_module *mod = NULL; mod = sym_kmod_module_get_module(l);