test: check for all errors in test-reread-partition-table

Otherwise if opening the loop dev fails, the test segfaults
dereferencing a NULL variable later

Follow-up for 757887d01d
This commit is contained in:
Luca Boccassi
2025-11-21 17:53:46 +00:00
committed by Zbigniew Jędrzejewski-Szmek
parent d1ae5e26c4
commit 12d2abe082

View File

@@ -70,6 +70,8 @@ TEST(rereadpt) {
LOCK_EX, &loop);
if (ERRNO_IS_NEG_PRIVILEGE(r) || ERRNO_IS_NOT_SUPPORTED(r))
return (void) log_tests_skipped("loopback block devices not available");
if (r < 0)
return (void) log_error_errno(r, "Failed to create loop device: %m");
_cleanup_free_ char *p = NULL;
ASSERT_OK(partition_node_of(loop->node, 1, &p));