aboutsummaryrefslogtreecommitdiffhomepage
path: root/System/Posix/Process.hsc
diff options
context:
space:
mode:
authorGravatar simonmar <unknown>2004-08-19 11:15:52 +0000
committerGravatar simonmar <unknown>2004-08-19 11:15:52 +0000
commit2c0d5751ed3d29f7080e98c5fa94289727c5c11d (patch)
tree59386b7abea4d312eccc9c32545d2a77d8146b3a /System/Posix/Process.hsc
parent2122158939042f99ef540967e5efcde256e7b458 (diff)
[project @ 2004-08-19 11:15:51 by simonmar]
Add filenames to all errors where it makes sense. I've added System.Posix.Error with a new family of error-throwing functions, throwErrnoPath*. This seemed to make the most sense: they don't belong in Foreign.C.Error (C by itself has no notion of paths). Fixes: [ 954378 ] getFileStatus does not include the file name in IO-Error
Diffstat (limited to 'System/Posix/Process.hsc')
-rw-r--r--System/Posix/Process.hsc11
1 files changed, 7 insertions, 4 deletions
diff --git a/System/Posix/Process.hsc b/System/Posix/Process.hsc
index ea06930..e0ea099 100644
--- a/System/Posix/Process.hsc
+++ b/System/Posix/Process.hsc
@@ -73,6 +73,7 @@ import Foreign.Storable ( Storable(..) )
import System.IO
import System.IO.Error
import System.Exit
+import System.Posix.Error
import System.Posix.Types
import System.Posix.Signals
import Control.Monad
@@ -244,8 +245,8 @@ executeFile path search args Nothing = do
withArray0 nullPtr cstrs $ \arr -> do
pPrPr_disableITimers
if search
- then throwErrnoIfMinus1_ "executeFile" (c_execvp s arr)
- else throwErrnoIfMinus1_ "executeFile" (c_execv s arr)
+ then throwErrnoPathIfMinus1_ "executeFile" path (c_execvp s arr)
+ else throwErrnoPathIfMinus1_ "executeFile" path (c_execv s arr)
executeFile path search args (Just env) = do
withCString path $ \s ->
@@ -256,8 +257,10 @@ executeFile path search args (Just env) = do
withArray0 nullPtr cenv $ \env_arr -> do
pPrPr_disableITimers
if search
- then throwErrnoIfMinus1_ "executeFile" (c_execvpe s arg_arr env_arr)
- else throwErrnoIfMinus1_ "executeFile" (c_execve s arg_arr env_arr)
+ then throwErrnoPathIfMinus1_ "executeFile" path
+ (c_execvpe s arg_arr env_arr)
+ else throwErrnoPathIfMinus1_ "executeFile" path
+ (c_execve s arg_arr env_arr)
-- this function disables the itimer, which would otherwise cause confusing
-- signals to be sent to the new process.