]> git.ipfire.org Git - thirdparty/systemd.git/blob - src/test/test-dlopen.c
varlink-idl: allow unbalanced quote and trailing backslash in comment
[thirdparty/systemd.git] / src / test / test-dlopen.c
1 /* SPDX-License-Identifier: LGPL-2.1-or-later */
2
3 #include <dlfcn.h>
4 #include <stdlib.h>
5
6 #include "macro.h"
7
8 int main(int argc, char **argv) {
9 void *handles[argc - 1];
10 int i;
11
12 for (i = 0; i < argc - 1; i++)
13 assert_se(handles[i] = dlopen(argv[i + 1], RTLD_NOW));
14
15 for (i--; i >= 0; i--)
16 assert_se(dlclose(handles[i]) == 0);
17
18 return EXIT_SUCCESS;
19 }