summarylogtreecommitdiffstats
path: root/fix.patch
diff options
context:
space:
mode:
authorDāvis Mosāns2022-08-16 04:23:47 +0300
committerDāvis Mosāns2022-08-16 04:24:24 +0300
commitd6867e8f59bdfcc7345625ed339ba89002d4f45c (patch)
tree6f8cd0413fa52b5abe2852cd2ae4a7fa7d522a63 /fix.patch
downloadaur-haskell-ioctl.tar.gz
First release
Diffstat (limited to 'fix.patch')
-rw-r--r--fix.patch20
1 files changed, 20 insertions, 0 deletions
diff --git a/fix.patch b/fix.patch
new file mode 100644
index 000000000000..feb69476b3a4
--- /dev/null
+++ b/fix.patch
@@ -0,0 +1,20 @@
+diff --git a/src-unix/Network/Socket/IOCtl.hs b/src-unix/Network/Socket/IOCtl.hs
+index bfd6d31..683c0b0 100644
+--- a/src-unix/Network/Socket/IOCtl.hs
++++ b/src-unix/Network/Socket/IOCtl.hs
+@@ -23,13 +23,14 @@ import Foreign
+ import Foreign.C
+ import Network.Socket
+ import System.IOControl
++import System.IO.Unsafe (unsafePerformIO)
+
+ foreign import ccall "ioctl" c_ioctl :: CInt -> CInt -> Ptr () -> IO CInt
+
+ c_ioctl' :: IOControl req d => Socket -> req -> Ptr d -> IO ()
+ c_ioctl' f req p =
+ throwErrnoIfMinus1_ "ioctl" $
+- c_ioctl (fdSocket f) (ioctlReq req) (castPtr p)
++ c_ioctl (unsafePerformIO $ fdSocket f) (ioctlReq req) (castPtr p)
+
+ -- | Calls a ioctl reading the structure after the call
+ ioctlsocket :: IOControl req d