]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
oomd: use ERRNO_IS_NOT_SUPPORTED and ERRNO_IS_PRIVILEGE
authorAnita Zhang <the.anitazha@gmail.com>
Wed, 21 Oct 2020 08:52:53 +0000 (01:52 -0700)
committerAnita Zhang <the.anitazha@gmail.com>
Thu, 22 Oct 2020 05:37:30 +0000 (22:37 -0700)
src/oom/test-oomd-util.c

index 38cae9e034200da358c6d6c2dd9f91fb406e75b4..5e7c1871540f4f74ef49ac4b72b71761f19249be 100644 (file)
@@ -57,7 +57,7 @@ static void test_oomd_cgroup_kill(void) {
 
         /* If we don't have permissions to set xattrs we're likely in a userns or missing capabilities */
         r = cg_set_xattr(SYSTEMD_CGROUP_CONTROLLER, cgroup, "user.oomd_test", "test", 4, 0);
-        if (IN_SET(r, -EPERM, -ENOTSUP))
+        if (ERRNO_IS_PRIVILEGE(r) || ERRNO_IS_NOT_SUPPORTED(r))
                 return (void) log_tests_skipped("Cannot set user xattrs");
 
         /* Do this twice to also check the increment behavior on the xattrs */