]> git.ipfire.org Git - thirdparty/systemd.git/commit
libaudit-util: fix build with audit disabled
authorAntonio Alvarez Feijoo <antonio.feijoo@suse.com>
Mon, 22 Sep 2025 15:27:27 +0000 (17:27 +0200)
committerLuca Boccassi <luca.boccassi@gmail.com>
Mon, 22 Sep 2025 17:17:52 +0000 (18:17 +0100)
commitf784a63cfad6a5425af2ebc02a1f9effec4fd079
tree3f679a677d00b3ce3de0dbcb1562529336ac1d70
parent346b7b6b4931fc6bee9e820e0160dd024a86ed52
libaudit-util: fix build with audit disabled

```
In file included from ../src/test/test-dlopen-so.c:21:
../src/test/test-dlopen-so.c: In function ‘run’:
../src/test/test-dlopen-so.c:53:23: error: implicit declaration of function ‘dlopen_libaudit’; did you mean ‘dlopen_libfido2’? [-Werror=implicit-function-declaration]
   53 |         ASSERT_DLOPEN(dlopen_libaudit, HAVE_AUDIT);
      |                       ^~~~~~~~~~~~~~~
../src/shared/tests.h:181:24: note: in definition of macro ‘ASSERT_OK’
  181 |                 typeof(expr) _result = (expr);                                                                  \
      |                        ^~~~
../src/test/test-dlopen-so.c:53:9: note: in expansion of macro ‘ASSERT_DLOPEN’
   53 |         ASSERT_DLOPEN(dlopen_libaudit, HAVE_AUDIT);
      |         ^~~~~~~~~~~~~
../src/test/test-dlopen-so.c:53:23: warning: nested extern declaration of ‘dlopen_libaudit’ [-Wnested-externs]
   53 |         ASSERT_DLOPEN(dlopen_libaudit, HAVE_AUDIT);
      |                       ^~~~~~~~~~~~~~~
../src/shared/tests.h:181:24: note: in definition of macro ‘ASSERT_OK’
  181 |                 typeof(expr) _result = (expr);                                                                  \
      |                        ^~~~
../src/test/test-dlopen-so.c:53:9: note: in expansion of macro ‘ASSERT_DLOPEN’
   53 |         ASSERT_DLOPEN(dlopen_libaudit, HAVE_AUDIT);
      |         ^~~~~~~~~~~~~

```

Follow-up for 4d8c5c657ae0829f93944a00302e7ce700913e54
src/shared/libaudit-util.c
src/shared/libaudit-util.h