fix timeouts
authorRudolf Polzer <divverent@alientrap.org>
Mon, 19 Jul 2010 06:34:34 +0000 (08:34 +0200)
committerRudolf Polzer <divverent@alientrap.org>
Mon, 19 Jul 2010 06:34:34 +0000 (08:34 +0200)
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: $!";