forked from josch/mmdebstrap
error out early if setup fails and thus the ext2 block reader returns EOF
This commit is contained in:
parent
a6a31e60eb
commit
6c5210a94f
1 changed files with 7 additions and 1 deletions
|
@ -5920,7 +5920,13 @@ sub main() {
|
||||||
my $numblocks = 0;
|
my $numblocks = 0;
|
||||||
close $nblkwriter;
|
close $nblkwriter;
|
||||||
if (!$options->{dryrun} && $format eq 'ext2') {
|
if (!$options->{dryrun} && $format eq 'ext2') {
|
||||||
chomp($numblocks = <$nblkreader>);
|
$numblocks = <$nblkreader>;
|
||||||
|
if (!defined $numblocks) {
|
||||||
|
# This can happen if the setup process died early and thus closes
|
||||||
|
# the pipe from the other and. The EOF is turned into undef.
|
||||||
|
error "failed to read required number of blocks";
|
||||||
|
}
|
||||||
|
chomp $numblocks;
|
||||||
}
|
}
|
||||||
close $nblkreader;
|
close $nblkreader;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue