aboutsummaryrefslogtreecommitdiffhomepage
path: root/System/Posix/IO.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/IO.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/IO.hsc')
-rw-r--r--System/Posix/IO.hsc3
1 files changed, 2 insertions, 1 deletions
diff --git a/System/Posix/IO.hsc b/System/Posix/IO.hsc
index 5b7169b..286e4ac 100644
--- a/System/Posix/IO.hsc
+++ b/System/Posix/IO.hsc
@@ -60,6 +60,7 @@ module System.Posix.IO (
import System.IO
import System.IO.Error
import System.Posix.Types
+import System.Posix.Error
import System.Posix.Internals
import Foreign
@@ -142,7 +143,7 @@ openFd :: FilePath
openFd name how maybe_mode (OpenFileFlags append exclusive noctty
nonBlock truncate) = do
withCString name $ \s -> do
- fd <- throwErrnoIfMinus1 "openFd" (c_open s all_flags mode_w)
+ fd <- throwErrnoPathIfMinus1 "openFd" name (c_open s all_flags mode_w)
return (Fd fd)
where
all_flags = creat .|. flags .|. open_mode