forked from josch/mmdebstrap
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.
This commit is contained in:
parent
c073d0b446
commit
f2a3f23acf
1 changed files with 5 additions and 5 deletions
10
mmdebstrap
10
mmdebstrap
|
@ -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…
Reference in a new issue