]> git.xonotic.org Git - xonotic/xonotic.git/blobdiff - misc/tools/xonotic-map-compiler
fix timeouts
[xonotic/xonotic.git] / misc / tools / xonotic-map-compiler
index bfc6593b5f8a665646a6ee9c0849b73c27f9efec..9ae0cec16434d1d2b78f0a38acb0a449c3663a05 100755 (executable)
@@ -183,11 +183,9 @@ sub q3map2(@)
                or die "fork: $!";
        if($pid) # parent
        {
-               if($timeout)
-               {
-                       local $SIG{ALRM} = sub { kill $pid; };
-                       alarm $timeout;
-               }
+               local $SIG{ALRM} = sub { kill $pid; };
+               alarm $timeout
+                       if $timeout;
                if(waitpid $pid, 0 != $pid)
                {
                        die "waitpid: did not return our child process $pid: $!";