From 71df002e0e0d9730e43e4749c966071cba9b72b2 Mon Sep 17 00:00:00 2001 From: simonm <unknown> Date: Fri, 15 Jan 1999 12:57:51 +0000 Subject: [PATCH] [project @ 1999-01-15 12:57:49 by simonm] H98 changes for non-cygwin targets. --- ghc/lib/misc/BSD.lhs | 8 ++++---- ghc/lib/misc/SocketPrim.lhs | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ghc/lib/misc/BSD.lhs b/ghc/lib/misc/BSD.lhs index c63d7df3a0b8..e7fbecfdb3d9 100644 --- a/ghc/lib/misc/BSD.lhs +++ b/ghc/lib/misc/BSD.lhs @@ -188,7 +188,7 @@ getServiceEntry = do setServiceEntry :: Bool -> IO () setServiceEntry flg = _ccall_ setservent stayOpen - where stayOpen = if flg then 1 else 0 + where stayOpen = (if flg then 1 else 0) :: Int endServiceEntry :: IO () endServiceEntry = _ccall_ endservent @@ -252,7 +252,7 @@ getProtocolEntry = do --setProtocolEntry :: Bool -> IO () -- Keep DB Open ? setProtocolEntry flg = _ccall_ setprotoent v - where v = if flg then 1 else 0 + where v = (if flg then 1 else 0) :: Int --endProtocolEntry :: IO () endProtocolEntry = _ccall_ endprotoent @@ -294,7 +294,7 @@ getHostEntry = do setHostEntry :: Bool -> IO () setHostEntry flg = _ccall_ sethostent v - where v = if flg then 1 else 0 + where v = (if flg then 1 else 0) :: Int endHostEntry :: IO () endHostEntry = _ccall_ endhostent @@ -352,7 +352,7 @@ getNetworkEntry = do setNetworkEntry :: Bool -> IO () setNetworkEntry flg = _ccall_ setnetent v - where v = if flg then 1 else 0 + where v = (if flg then 1 else 0) :: Int endNetworkEntry :: IO () endNetworkEntry = _ccall_ endnetent diff --git a/ghc/lib/misc/SocketPrim.lhs b/ghc/lib/misc/SocketPrim.lhs index 7f1472eb49f1..1d2f9c88bf00 100644 --- a/ghc/lib/misc/SocketPrim.lhs +++ b/ghc/lib/misc/SocketPrim.lhs @@ -267,7 +267,7 @@ bindSocket :: Socket -- Unconnected Socket bindSocket (MkSocket s _family _stype _protocol socketStatus) addr = do #ifndef cygwin32_TARGET_OS - let isDomainSocket = if family == AF_UNIX then 1 else (0::Int) + let isDomainSocket = if _family == AF_UNIX then 1 else (0::Int) #else let isDomainSocket = 0 #endif @@ -302,7 +302,7 @@ connect :: Socket -- Unconnected Socket connect (MkSocket s _family _stype _protocol socketStatus) addr = do #ifndef cygwin32_TARGET_OS - let isDomainSocket = if family == AF_UNIX then 1 else (0::Int) + let isDomainSocket = if _family == AF_UNIX then 1 else (0::Int) #else let isDomainSocket = 0 #endif @@ -1082,7 +1082,7 @@ sIsWritable = sIsReadable -- sort of. sIsAcceptable :: Socket -> IO Bool #ifndef cygwin32_TARGET_OS -sIsAcceptable (MkSocket _ AF_UNIX Stream _ _) = do +sIsAcceptable (MkSocket _ AF_UNIX Stream _ status) = do value <- readIORef status return (value == Connected || value == Bound || value == Listening) sIsAcceptable (MkSocket _ AF_UNIX _ _ _) = return False -- GitLab