Author: eelco
Date: 2010-06-19 21:57:20 +0000 (Sat, 19 Jun 2010)
New Revision: 22338

You can view the changes in this commit at:
   https://svn.nixos.org/viewvc/nix?rev=22338&view=rev

Modified:
   nixos/branches/boot-order/lib/test-driver/Machine.pm

Log:
* Put a timeout on the call to readline.


Changes:

Modified: nixos/branches/boot-order/lib/test-driver/Machine.pm
===================================================================
--- nixos/branches/boot-order/lib/test-driver/Machine.pm        2010-06-19 
21:35:18 UTC (rev 22337)
+++ nixos/branches/boot-order/lib/test-driver/Machine.pm        2010-06-19 
21:57:20 UTC (rev 22338)
@@ -209,9 +209,12 @@
 
     $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;
 }
 

_______________________________________________
nix-commits mailing list
[email protected]
http://mail.cs.uu.nl/mailman/listinfo/nix-commits

Reply via email to