Skip to content

Commit 7cc239a

Browse files
committed
fixing a gap between Unix and Windows.
1 parent 507a2c0 commit 7cc239a

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

Network/Socket/Internal.hs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,9 @@ module Network.Socket.Internal
3434
, throwSocketErrorIfMinus1Retry
3535
, throwSocketErrorIfMinus1Retry_
3636
, throwSocketErrorIfMinus1RetryMayBlock
37+
#if defined(mingw32_HOST_OS)
3738
, throwSocketErrorIfMinus1ButRetry
38-
39+
#endif
3940
-- ** Guards that wait and retry if the operation would block
4041
-- | These guards are based on 'throwSocketErrorIfMinus1RetryMayBlock'.
4142
-- They wait for socket readiness if the action fails with @EWOULDBLOCK@
@@ -183,6 +184,9 @@ throwSocketErrorIfMinus1ButRetry exempt name act = do
183184
else throwSocketError name
184185
else return r
185186

187+
throwSocketErrorIfMinus1Retry
188+
= throwSocketErrorIfMinus1ButRetry (const False)
189+
186190
throwSocketErrorCode name rc = do
187191
pstr <- c_getWSError rc
188192
str <- peekCString pstr
@@ -216,9 +220,6 @@ throwSocketErrorCode loc errno =
216220

217221
#endif
218222

219-
throwSocketErrorIfMinus1Retry
220-
= throwSocketErrorIfMinus1ButRetry (const False)
221-
222223
-- | Like 'throwSocketErrorIfMinus1Retry', but if the action fails with
223224
-- @EWOULDBLOCK@ or similar, wait for the socket to be read-ready,
224225
-- and try again.

0 commit comments

Comments
 (0)