tree-wide: drop merely used _cleanup_ macros, and introduce several new ones (#36071)

This commit is contained in:
Yu Watanabe
2025-01-21 03:41:27 +09:00
committed by GitHub
28 changed files with 56 additions and 54 deletions
-6
View File
@@ -43,12 +43,6 @@ int keep_capability(cap_value_t cv);
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());
}
+1 -1
View File
@@ -558,7 +558,7 @@ int userns_acquire(const char *uid_map, const char *gid_map) {
}
int userns_enter_and_pin(int userns_fd, pid_t *ret_pid) {
_cleanup_(close_pairp) int pfd[2] = EBADF_PAIR;
_cleanup_close_pair_ int pfd[2] = EBADF_PAIR;
_cleanup_(sigkill_waitp) pid_t pid = 0;
ssize_t n;
char x;