diff options
author | David Terei <davidterei@gmail.com> | 2012-01-09 17:37:14 -0800 |
---|---|---|
committer | David Terei <davidterei@gmail.com> | 2012-01-09 17:37:14 -0800 |
commit | b2a695f3b7e1698d35b3e2be65198882e50eb252 (patch) | |
tree | f4dd6af987f15409da113a58cb8a2311d295f085 /System/Posix/Temp.hsc | |
parent | 4b867e2609f8e3caf1ceac751dc8a09aa7f2397a (diff) |
Use error not ioError for consistency.
Diffstat (limited to 'System/Posix/Temp.hsc')
-rw-r--r-- | System/Posix/Temp.hsc | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/System/Posix/Temp.hsc b/System/Posix/Temp.hsc index 26ce1c3..e960ea3 100644 --- a/System/Posix/Temp.hsc +++ b/System/Posix/Temp.hsc @@ -23,9 +23,6 @@ module System.Posix.Temp ( #include "HsUnix.h" -#if !HAVE_MKSTEMPS -import Control.Exception (throwIO) -#endif import Foreign.C import System.IO #if !HAVE_MKDTEMP @@ -93,8 +90,8 @@ foreign import ccall unsafe "HsUnix.h __hscore_mkstemps" -- If you are using as system that doesn't support the mkstemps glibc function -- (supported in glibc > 2.11) then this function simply throws an error. mkstemps :: String -> String -> IO (FilePath, Handle) -mkstemps prefix suffix = do #if HAVE_MKSTEMPS +mkstemps prefix suffix = do let template = prefix ++ "XXXXXX" ++ suffix lenOfsuf = (fromIntegral $ length suffix) :: CInt withFilePath template $ \ ptr -> do @@ -103,7 +100,7 @@ mkstemps prefix suffix = do h <- fdToHandle (Fd fd) return (name, h) #else - throwIO . userError $ "mkstemps: System does not have a mkstemp C function." +mkstemps = error "System.Posix.Temp.mkstemps: not available on this platform" #endif #if HAVE_MKDTEMP |