in reply to Detecting hung conditions in win32

Try using alarm inside an eval:
eval { local $SIG{'ALRM'} = { die("Timeout\n"); }; alarm(60); system('build.sh'); alarm(0); }; if ($@ =~ /^Timeout/) { die("Build timed out\n"); }

Remember: There's always one more bug.

Replies are listed 'Best First'.
Re^2: Detecting hung conditions in win32
by Zadeh (Beadle) on Feb 21, 2006 at 18:55 UTC
    Thanks, but a problem there is that it doesn't really detect the hung state, but kills it after a set amount of time (60 seconds), right?