tree-wide: add ERRNO_IS_XATTR_ABSENT() helper

We check the same list of error codes on various xattr operations, and
we should on some more. Add a common helper for this purpose.
This commit is contained in:
Lennart Poettering
2022-10-10 16:00:15 +02:00
parent dcf1bf3b6d
commit 00675c363f
15 changed files with 29 additions and 23 deletions
+1 -1
View File
@@ -3254,7 +3254,7 @@ static int setup_smack(
_cleanup_free_ char *exec_label = NULL;
r = mac_smack_read_fd(executable_fd, SMACK_ATTR_EXEC, &exec_label);
if (r < 0 && !IN_SET(r, -ENODATA, -EOPNOTSUPP))
if (r < 0 && !ERRNO_IS_XATTR_ABSENT(r))
return r;
r = mac_smack_apply_pid(0, exec_label ? : manager->default_smack_process_label);