X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/f26cd6685142f04fd0024837cd5251ceb34dbc41..a016b25437d8095a80a8d31965c5a33631839f24:/tools/tesh/tesh.pl diff --git a/tools/tesh/tesh.pl b/tools/tesh/tesh.pl index 4bbeb20fca..e83cbc6441 100755 --- a/tools/tesh/tesh.pl +++ b/tools/tesh/tesh.pl @@ -1,4 +1,4 @@ -#! /usr/bin/perl +#! /usr/bin/env perl # Copyright (c) 2012-2014. The SimGrid Team. # All rights reserved. @@ -280,6 +280,8 @@ sub exec_cmd { die "fork() failed: $!" unless defined $forked; if ( $forked == 0 ) { # child sleep $time_to_wait; + kill(SIGTERM, $cmd{'pid'}); + sleep 1; kill(SIGKILL, $cmd{'pid'}); exit $time_to_wait; } @@ -363,7 +365,7 @@ sub parse_out { # Did we timeout ? If yes, handle it. If not, kill the forked process. - if($timeout==-1 and $gotret eq "got signal SIGKILL"){ + if($timeout==-1 and ($gotret eq "got signal SIGTERM" or $gotret eq "got signal SIGKILL")){ $gotret="return code 0"; $timeout=1; $gotret= "timeout after $time_to_wait sec";