Also moves cap_free_charpp() to test-cap-list.c, as it is used only
there.
DEFINE_TRIVIAL_CLEANUP_FUNC_FULL(cap_t, cap_free, NULL);
#define _cleanup_cap_free_ _cleanup_(cap_freep)
-static inline void cap_free_charpp(char **p) {
- if (*p)
- cap_free(*p);
-}
-#define _cleanup_cap_free_charp_ _cleanup_(cap_free_charpp)
-
static inline uint64_t all_capabilities(void) {
return UINT64_MAX >> (63 - cap_last_cap());
}
#include "strv.h"
#include "tests.h"
+static inline void cap_free_charpp(char **p) {
+ if (*p)
+ cap_free(*p);
+}
+
/* verify the capability parser */
TEST(cap_list) {
assert_se(!capability_to_name(-1));
assert_se(capability_from_name("-1") == -EINVAL);
for (int i = 0; i < capability_list_length(); i++) {
- _cleanup_cap_free_charp_ char *a = NULL;
+ _cleanup_(cap_free_charpp) char *a = NULL;
const char *b;
unsigned u;