diff options
author | Thomas Haller <thaller@redhat.com> | 2024-04-22 07:39:40 (GMT) |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2024-04-22 08:30:56 (GMT) |
commit | 264b244e4d0044d6598d247e94f6d39defaede90 (patch) | |
tree | 304aae9f35b76405958ded3dd1daa79d280d9754 /lib/utils.c | |
parent | dbe21b8d64cdfd38476cddee0bb766fa7d4a7c3c (diff) | |
download | libnl-264b244e4d0044d6598d247e94f6d39defaede90.zip libnl-264b244e4d0044d6598d247e94f6d39defaede90.tar.gz libnl-264b244e4d0044d6598d247e94f6d39defaede90.tar.bz2 |
utils: always define nl_debug_dp
Otherwise, whether libnl-3.so exports nl_debug_dp depends on NL_DEBUG.
That is ugly. It also breaks the linker checking the symbol versioning
file with the "--no-undefined-version" flag.
Instead, always define it. It's small anyway.
Reported-by: lch361 <lch361@skiff.com>
See-also: https://github.com/thom311/libnl/pull/375
Diffstat (limited to 'lib/utils.c')
-rw-r--r-- | lib/utils.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/utils.c b/lib/utils.c index 2363c02..471cd21 100644 --- a/lib/utils.c +++ b/lib/utils.c @@ -52,7 +52,6 @@ int nl_debug = 0; /** @cond SKIP */ -#if NL_DEBUG struct nl_dump_params nl_debug_dp = { .dp_type = NL_DUMP_DETAILS, }; @@ -61,7 +60,7 @@ static void _nl_init nl_debug_init(void) { char *nldbg, *end; - if ((nldbg = getenv("NLDBG"))) { + if (NL_DEBUG && (nldbg = getenv("NLDBG"))) { long level = strtol(nldbg, &end, 0); if (nldbg != end) nl_debug = level; @@ -69,7 +68,6 @@ static void _nl_init nl_debug_init(void) nl_debug_dp.dp_fd = stderr; } -#endif int __nl_read_num_str_file(const char *path, int (*cb)(long, const char *)) { |