]> git.xonotic.org Git - xonotic/xonotic.git/blobdiff - misc/tools/xonotic-map-compiler
REALLY fix timeout feature
[xonotic/xonotic.git] / misc / tools / xonotic-map-compiler
index 9ae0cec16434d1d2b78f0a38acb0a449c3663a05..596a511ca259f5d3774de7678cde8a10cc181b34 100755 (executable)
@@ -183,14 +183,15 @@ sub q3map2(@)
                or die "fork: $!";
        if($pid) # parent
        {
-               local $SIG{ALRM} = sub { kill $pid; };
+               local $SIG{ALRM} = sub { warn "SIGALRM caught\n"; kill TERM => $pid; };
                alarm $timeout
                        if $timeout;
-               if(waitpid $pid, 0 != $pid)
+               if(waitpid($pid, 0) != $pid)
                {
                        die "waitpid: did not return our child process $pid: $!";
                }
-               return !$?;
+               alarm 0;
+               return ($? == 0);
        }
        else # child
        {