tree-wide: use cocinnelle to apply _NEG_ macros

This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2023-08-16 12:52:56 +02:00
parent b0be985cdd
commit 13d84288bc
13 changed files with 66 additions and 23 deletions
+2 -2
View File
@@ -135,12 +135,12 @@ static int is_delegated(int cgfd, const char *path) {
assert(cgfd >= 0 || path);
r = getxattr_malloc(cgfd < 0 ? path : FORMAT_PROC_FD_PATH(cgfd), "trusted.delegate", &b);
if (r < 0 && ERRNO_IS_XATTR_ABSENT(r)) {
if (ERRNO_IS_NEG_XATTR_ABSENT(r)) {
/* If the trusted xattr isn't set (preferred), then check the untrusted one. Under the
* assumption that whoever is trusted enough to own the cgroup, is also trusted enough to
* decide if it is delegated or not this should be safe. */
r = getxattr_malloc(cgfd < 0 ? path : FORMAT_PROC_FD_PATH(cgfd), "user.delegate", &b);
if (r < 0 && ERRNO_IS_XATTR_ABSENT(r))
if (ERRNO_IS_NEG_XATTR_ABSENT(r))
return false;
}
if (r < 0)
+2 -2
View File
@@ -1279,8 +1279,8 @@ int varlink_wait(Varlink *v, usec_t timeout) {
return events;
r = fd_wait_for_event(fd, events, t);
if (r < 0 && ERRNO_IS_TRANSIENT(r)) /* Treat EINTR as not a timeout, but also nothing happened, and
* the caller gets a chance to call back into us */
if (ERRNO_IS_NEG_TRANSIENT(r)) /* Treat EINTR as not a timeout, but also nothing happened, and
* the caller gets a chance to call back into us */
return 1;
if (r <= 0)
return r;