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