[project @ 2003-06-05 14:04:28 by stolz]
[ghc-hetmet.git] / ghc / compiler / main / SysTools.lhs
index 5ca2765..20339bc 100644 (file)
@@ -712,9 +712,6 @@ runSomething phase_name pgm args
  = traceCmd phase_name (concat (intersperse " " (pgm:quoteargs))) $
    do
 #ifndef mingw32_HOST_OS
-          installHandler sigCHLD Ignore Nothing
-          -- avoid strange interaction with waitpid():
-          installHandler sigCONT Ignore Nothing
           mpid <- forkProcess
           exit_code <- case mpid of
             Nothing -> do -- Child
@@ -723,7 +720,16 @@ runSomething phase_name pgm args
              -- NOT REACHED
               return ExitSuccess
             Just child -> do -- Parent
-              Just (Exited res) <- getProcessStatus True True child
+#if __GLASGOW_HASKELL__ <= 504
+              -- avoid interaction with broken getProcessStatus-FFI:
+              oldHandler <- installHandler sigCONT Ignore Nothing
+#endif
+              Just (Exited res) <- getProcessStatus True False child
+#if __GLASGOW_HASKELL__ <= 504
+              -- restore handler
+              installHandler sigCONT oldHandler Nothing
+#endif
+
               return res
 #else
           exit_code <- rawSystem cmd_line