Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Network/Socket/Activation.hs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{-# LANGUAGE CPP #-}
{-# LANGUAGE ForeignFunctionInterface #-}
-- | This is a module for systemd socket activation. See
-- <http://0pointer.de/blog/projects/socket-activation.html> and
Expand Down Expand Up @@ -33,6 +34,9 @@ getActivatedSockets = runMaybeT $ do
mapM makeSocket [fdStart .. fdStart + listenFDs - 1]
where makeSocket :: CInt -> MaybeT IO Socket
makeSocket fd = do
#if MIN_VERSION_network(3,0,0)
lift $ mkSocket fd
#else
fam <- socketFamily fd
typ <- socketType fd
stat <- socketStatus fd
Expand Down Expand Up @@ -72,3 +76,5 @@ foreign import ccall unsafe "socket_type"

foreign import ccall unsafe "socket_listening"
c_socket_listening :: CInt -> IO CInt

#endif