Fix havemknod test

"last" only exits the innermost block, thus we need a label. Since
blocks are semantically the same as loops that only execute once, we
also replace the while() with a single block.
main
parent c073d0b446
commit f2a3f23acf
Signed by untrusted user: josch
GPG Key ID: F2CBA5C78FBD83E1

@ -367,7 +367,7 @@ sub havemknod($) {
if (-e "$root/test-dev-null") {
die "/test-dev-null already exists";
}
while ($havemknod == 0) {
TEST: {
# we fork so that we can read STDERR
my $pid = open my $fh, '-|' // die "failed to fork(): $!";
if ($pid == 0) {
@ -379,10 +379,10 @@ sub havemknod($) {
chomp (my $content = do { local $/; <$fh> });
close $fh;
{
last unless $? == 0 and $content eq '';
last unless -c "$root/test-dev-null";
last unless open my $fh, '>', "$root/test-dev-null";
last unless print $fh 'test';
last TEST unless $? == 0 and $content eq '';
last TEST unless -c "$root/test-dev-null";
last TEST unless open my $fh, '>', "$root/test-dev-null";
last TEST unless print $fh 'test';
}
$havemknod = 1;
}

Loading…
Cancel
Save