mirror of
https://github.com/morgan9e/systemd
synced 2026-04-14 00:14:32 +09:00
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:
committed by
Zbigniew Jędrzejewski-Szmek
parent
d1ae5e26c4
commit
12d2abe082
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user