diff options
author | Mike Yuan <me@yhndnzj.com> | 2024-12-13 13:01:27 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-12-13 13:01:27 +0100 |
commit | 8a1068931d105ab4d767ee264507c3336048d01a (patch) | |
tree | 34297e234abb0ca4f4d6130a2a63f6b279765afb /src/test | |
parent | basic/fileio: two modernizations (#35559) (diff) | |
parent | test-loop-block: return -77 on skip in more places (diff) | |
download | systemd-8a1068931d105ab4d767ee264507c3336048d01a.tar.xz systemd-8a1068931d105ab4d767ee264507c3336048d01a.zip |
Couple small cleanups (#35593)
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/test-loop-block.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/test/test-loop-block.c b/src/test/test-loop-block.c index e69c0d5caf..921049c3fb 100644 --- a/src/test/test-loop-block.c +++ b/src/test/test-loop-block.c @@ -224,15 +224,11 @@ static int run(int argc, char *argv[]) { dissected = dissected_image_unref(dissected); #endif - if (geteuid() != 0 || have_effective_cap(CAP_SYS_ADMIN) <= 0) { - log_tests_skipped("not running privileged"); - return 0; - } + if (geteuid() != 0 || have_effective_cap(CAP_SYS_ADMIN) <= 0) + return log_tests_skipped("not running privileged"); - if (detect_container() > 0) { - log_tests_skipped("Test not supported in a container, requires udev/uevent notifications"); - return 0; - } + if (detect_container() > 0) + return log_tests_skipped("Test not supported in a container, requires udev/uevent notifications"); assert_se(loop_device_make(fd, O_RDWR, 0, UINT64_MAX, 0, LO_FLAGS_PARTSCAN, LOCK_EX, &loop) >= 0); |