X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=Foreign%2FC%2FError.hs;h=ac26141a3e0abb5521208af7f11f43c7a8ea71e8;hb=9c28b7a82656c693abdb179dab927bb8c2238ba1;hp=7cf294cd139a47eba931dc89606f43ed8813a5cf;hpb=33a64642f17054fa3b194e40b3819a1846bee24e;p=ghc-base.git diff --git a/Foreign/C/Error.hs b/Foreign/C/Error.hs index 7cf294c..ac26141 100644 --- a/Foreign/C/Error.hs +++ b/Foreign/C/Error.hs @@ -1,4 +1,4 @@ -{-# OPTIONS -fno-implicit-prelude -#include "HsBase.h" #-} +{-# OPTIONS_GHC -fno-implicit-prelude -#include "HsBase.h" #-} ----------------------------------------------------------------------------- -- | -- Module : Foreign.C.Error @@ -91,7 +91,7 @@ module Foreign.C.Error ( -- calculated for us -- #ifndef __NHC__ -#include "config.h" +#include "HsBaseConfig.h" #endif -- system dependent imports @@ -119,12 +119,13 @@ import GHC.IOBase import GHC.Num import GHC.Base #else -import System.IO ( IOError, Handle, ioError ) +import System.IO ( Handle ) +import System.IO.Error ( IOError, ioError ) import System.IO.Unsafe ( unsafePerformIO ) #endif #ifdef __HUGS__ -{-# CBITS PrelIOUtils.c #-} +{-# CFILES cbits/PrelIOUtils.c #-} #endif @@ -471,7 +472,7 @@ errnoToIOError loc errno maybeHdl maybeName = unsafePerformIO $ do | errno == eAFNOSUPPORT = UnsupportedOperation | errno == eAGAIN = ResourceExhausted | errno == eALREADY = AlreadyExists - | errno == eBADF = OtherError + | errno == eBADF = InvalidArgument | errno == eBADMSG = InappropriateType | errno == eBADRPC = OtherError | errno == eBUSY = ResourceBusy