From bd4a59fe77f08752a08ef748e739428a59869657 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Mon, 20 Jun 2005 21:26:49 +0000 Subject: [PATCH] Fix handling of timeouts. --- src/utils/pintos | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/utils/pintos b/src/utils/pintos index 8721db3..348c6ab 100755 --- a/src/utils/pintos +++ b/src/utils/pintos @@ -682,10 +682,12 @@ sub relay_signal { # Interrupts $pid and dies with a timeout error message. sub timeout { my ($pid) = @_; - relay_signal ($pid, "INT"); + kill "INT", $pid; + waitpid ($pid, 0); + seek (STDOUT, 0, 2); my ($load_avg) = `uptime` =~ /(load average:.*)$/i; - print "TIMEOUT after $timeout seconds"; + print "\nTIMEOUT after $timeout seconds"; print " - $load_avg" if defined $load_avg; print "\n"; - exit (2); + exit 0; } -- 2.30.2