aboutsummaryrefslogtreecommitdiffhomepage
path: root/System/Posix/Process.hsc
diff options
context:
space:
mode:
authorGravatar Simon Marlow <marlowsd@gmail.com>2009-01-14 12:47:26 +0000
committerGravatar Simon Marlow <marlowsd@gmail.com>2009-01-14 12:47:26 +0000
commit9b1a1e79b7602fcc52dbf08239d15a4430836629 (patch)
treec7a7bb61629691ac36d0c358827c7fa0a459de28 /System/Posix/Process.hsc
parent47f4a8aaee12243c2df68e19236234dbea14c3ff (diff)
generalise type of executeFile (#2948)
Diffstat (limited to 'System/Posix/Process.hsc')
-rw-r--r--System/Posix/Process.hsc4
1 files changed, 3 insertions, 1 deletions
diff --git a/System/Posix/Process.hsc b/System/Posix/Process.hsc
index d092454..71c286e 100644
--- a/System/Posix/Process.hsc
+++ b/System/Posix/Process.hsc
@@ -278,7 +278,7 @@ executeFile :: FilePath -- ^ Command
-> Bool -- ^ Search PATH?
-> [String] -- ^ Arguments
-> Maybe [(String, String)] -- ^ Environment
- -> IO ()
+ -> IO a
executeFile path search args Nothing = do
withCString path $ \s ->
withMany withCString (path:args) $ \cstrs ->
@@ -287,6 +287,7 @@ executeFile path search args Nothing = do
if search
then throwErrnoPathIfMinus1_ "executeFile" path (c_execvp s arr)
else throwErrnoPathIfMinus1_ "executeFile" path (c_execv s arr)
+ return undefined -- never reached
executeFile path search args (Just env) = do
withCString path $ \s ->
@@ -301,6 +302,7 @@ executeFile path search args (Just env) = do
(c_execvpe s arg_arr env_arr)
else throwErrnoPathIfMinus1_ "executeFile" path
(c_execve s arg_arr env_arr)
+ return undefined -- never reached
foreign import ccall unsafe "execvp"
c_execvp :: CString -> Ptr CString -> IO CInt