Skip to content

Commit 9c5789c

Browse files
committed
test-loop-block: return -77 on skip in more places
(cherry picked from commit 81e0693) (cherry picked from commit 1fb4673) (cherry picked from commit 8f92f75) (cherry picked from commit 543784e) (cherry picked from commit 27bb6c8) (cherry picked from commit 7b878c2)
1 parent d7464fc commit 9c5789c

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

src/test/test-loop-block.c

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -218,15 +218,11 @@ static int run(int argc, char *argv[]) {
218218
dissected = dissected_image_unref(dissected);
219219
#endif
220220

221-
if (geteuid() != 0 || have_effective_cap(CAP_SYS_ADMIN) <= 0) {
222-
log_tests_skipped("not running privileged");
223-
return 0;
224-
}
221+
if (geteuid() != 0 || have_effective_cap(CAP_SYS_ADMIN) <= 0)
222+
return log_tests_skipped("not running privileged");
225223

226-
if (detect_container() > 0) {
227-
log_tests_skipped("Test not supported in a container, requires udev/uevent notifications");
228-
return 0;
229-
}
224+
if (detect_container() > 0)
225+
return log_tests_skipped("Test not supported in a container, requires udev/uevent notifications");
230226

231227
assert_se(loop_device_make(fd, O_RDWR, 0, UINT64_MAX, 0, LO_FLAGS_PARTSCAN, LOCK_EX, &loop) >= 0);
232228

0 commit comments

Comments
 (0)