Malcolm:
> Does anyone know what might be causing the following error from a
> program that uses System.system?

>     Fail: interrupted Action: system Reason: Interrupted system call

> The shell command given to System.system runs and terminates with a
> non-zero exit code (actually 8).  I expected to bind the exit result
> of the shell command and display it, but I did not expect the entire
> program to terminate instead.

> Unfortunately, small examples do not seem to trigger the problem.


It sounds a little like a problem I had where trap 26 (I think this is
a timer signal) was interrupting the subprocess.  Nowadays I use this
function:
  
  my_system :: String -> IO ExitCode
  my_system xs = do
    -- putStrLn xs -- for debugging
    -- Bugfix for ghc (may not be needed in recent versions of GHC)
    rc <- System.system ("trap '' 26; " ++ xs)
    unless (rc == ExitSuccess) $ putStrLn xs
    return rc
  
The extra putStrLns are, of course, optional.

--
Alastair

_______________________________________________
Glasgow-haskell-bugs mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to