Skip to content

Commit 1e6f0f8

Browse files
rblazekazu-yamamoto
authored andcommitted
Suppress errors from removeFile in UNIX bind
removeFile may fail to delete socket because of lack of permissions, and throw an error which is unrelated to bind() itself.
1 parent 080c4b8 commit 1e6f0f8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Network/Socket/SockAddr.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ bind s a = case a of
6161
Left e2 | not (isDoesNotExistError e2) -> throwIO (e2 :: IOException)
6262
_ -> do
6363
-- socket not actually in use, remove it and retry bind
64-
removeFile p
64+
void (try $ removeFile p :: IO (Either IOError ()))
6565
G.bind s a
6666
_ -> G.bind s a
6767

0 commit comments

Comments
 (0)