Skip to content

Commit

Permalink
moving the comment (suggested by @endgame)
Browse files Browse the repository at this point in the history
  • Loading branch information
kazu-yamamoto committed Sep 6, 2024
1 parent ff99e97 commit e32a05e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Network/Socket/Info.hsc
Original file line number Diff line number Diff line change
Expand Up @@ -274,8 +274,6 @@ getAddrInfoNE hints node service = alloc getaddrinfo
ret <- c_getaddrinfo c_node c_service c_hints ptr_ptr_addrs
if ret == 0 then do
ptr_addrs <- peek ptr_ptr_addrs
-- POSIX requires that getaddrinfo(3) returns at least one addrinfo.
-- See: http://pubs.opengroup.org/onlinepubs/9699919799/functions/getaddrinfo.html
ais <- followAddrInfo ptr_addrs
return ais
else do
Expand Down Expand Up @@ -315,6 +313,8 @@ getAddrInfoList hints node service =

followAddrInfo :: Ptr AddrInfo -> IO (NonEmpty AddrInfo)
followAddrInfo ptr_ai
-- POSIX requires that getaddrinfo(3) returns at least one addrinfo.
-- See: http://pubs.opengroup.org/onlinepubs/9699919799/functions/getaddrinfo.html
| ptr_ai == nullPtr = ioError $ mkIOError NoSuchThing "getaddrinfo must return at least one addrinfo" Nothing Nothing
| otherwise = do
a <- peek ptr_ai
Expand Down

0 comments on commit e32a05e

Please sign in to comment.