summaryrefslogtreecommitdiff
path: root/Monky/MPD.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Monky/MPD.hs')
-rw-r--r--Monky/MPD.hs7
1 files changed, 6 insertions, 1 deletions
diff --git a/Monky/MPD.hs b/Monky/MPD.hs
index 500c88d..31b54c1 100644
--- a/Monky/MPD.hs
+++ b/Monky/MPD.hs
@@ -217,7 +217,12 @@ getMPDSocket host port = do
-- |Get the raw 'Fd' from the 'MPDSocket' for eventing api
getMPDFd :: MPDSocket -> IO Fd
-getMPDFd (MPDSocket s) = return . Fd $fdSocket s
+getMPDFd (MPDSocket s) =
+#if MIN_VERSION_network(3,0,0)
+ Fd <$> unsafeFdSocket s
+#else
+ pure . Fd $ fdSocket s
+#endif
recvMessage :: MPDSock -> ExceptT String IO [Text]