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
--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
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
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
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
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
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