summaryrefslogtreecommitdiff
path: root/libraries/base/System
diff options
context:
space:
mode:
authorross <unknown>2005-01-31 18:33:48 +0000
committerross <unknown>2005-01-31 18:33:48 +0000
commit7a2b4ed7830e04111ca772473626adc70b90d829 (patch)
treecca1c440c3d09d2f4bdba11297239fba0d01d65e /libraries/base/System
parentc8d9c29b142275d388160dc848cc35d8a6f6f151 (diff)
downloadhaskell-7a2b4ed7830e04111ca772473626adc70b90d829.tar.gz
[project @ 2005-01-31 18:33:48 by ross]
fix for non-GHC
Diffstat (limited to 'libraries/base/System')
-rw-r--r--libraries/base/System/Process/Internals.hs22
1 files changed, 16 insertions, 6 deletions
diff --git a/libraries/base/System/Process/Internals.hs b/libraries/base/System/Process/Internals.hs
index 474c662aa8..75a0eacbe0 100644
--- a/libraries/base/System/Process/Internals.hs
+++ b/libraries/base/System/Process/Internals.hs
@@ -18,7 +18,10 @@ module System.Process.Internals (
ProcessHandle(..), PHANDLE,
#if !defined(mingw32_HOST_OS) && !defined(__MINGW32__)
pPrPr_disableITimers, c_execvpe,
- runProcessPosix, ignoreSignal, defaultSignal,
+# ifdef __GLASGOW_HASKELL__
+ runProcessPosix,
+# endif
+ ignoreSignal, defaultSignal,
#endif
commandToProcess,
withFilePathException, withCEnvironment
@@ -28,8 +31,12 @@ import Prelude -- necessary to get dependencies right
#if !defined(mingw32_HOST_OS) && !defined(__MINGW32__)
import System.Posix.Types ( CPid )
+# ifdef __GLASGOW_HASKELL__
import GHC.IOBase ( haFD, FD, Exception(..), IOException(..) )
import GHC.Handle ( stdin, stdout, stderr, withHandle_ )
+# elif __HUGS__
+import Hugs.Exception ( Exception(..), IOException(..) )
+# endif
import System.IO ( Handle )
import Data.Maybe ( fromMaybe )
#else
@@ -78,11 +85,12 @@ foreign import ccall unsafe "execvpe"
#endif
+#if !defined(mingw32_HOST_OS) && !defined(__MINGW32__)
+
+#ifdef __GLASGOW_HASKELL__
-- -----------------------------------------------------------------------------
-- POSIX runProcess with signal handling in the child
-#if !defined(mingw32_HOST_OS) && !defined(__MINGW32__)
-
runProcessPosix
:: String
-> FilePath -- ^ Filename of the executable
@@ -123,9 +131,6 @@ runProcessPosix fun cmd args mb_cwd mb_env mb_stdin mb_stdout mb_stderr
set_int inthand set_quit quithand
return (ProcessHandle ph)
-ignoreSignal = CONST_SIG_IGN :: CLong
-defaultSignal = CONST_SIG_DFL :: CLong
-
foreign import ccall unsafe "runProcess"
c_runProcess
:: Ptr CString -- args
@@ -140,6 +145,11 @@ foreign import ccall unsafe "runProcess"
-> CLong -- SIGQUIT handler
-> IO PHANDLE
+#endif /* __GLASGOW_HASKELL__ */
+
+ignoreSignal = CONST_SIG_IGN :: CLong
+defaultSignal = CONST_SIG_DFL :: CLong
+
#endif
-- ----------------------------------------------------------------------------