* Put a timeout on the call to readline.

svn path=/nixos/branches/boot-order/; revision=22338
This commit is contained in:
Eelco Dolstra 2010-06-19 21:57:20 +00:00
parent 363806e89b
commit 411139148d

View file

@ -209,9 +209,12 @@ sub connect {
$self->start;
my $line = readline $self->{socket} or die;
local $SIG{ALRM} = sub { die "timed out waiting for the guest to connect\n"; };
alarm 300;
readline $self->{socket} or die;
alarm 0;
$self->log("connected to guest root shell");
$self->{connected} = 1;
}