2014-10-15 18:37:21 +00:00
|
|
|
From 478fc7ae42030c1345e75727e54e1f8f895d3e22 Mon Sep 17 00:00:00 2001
|
2013-10-18 20:19:22 +00:00
|
|
|
From: dummy <dummy@example.com>
|
2014-10-15 18:37:21 +00:00
|
|
|
Date: Wed, 15 Oct 2014 15:16:21 +0000
|
|
|
|
Subject: [PATCH] avoid accept4
|
2013-04-19 20:32:16 +00:00
|
|
|
|
|
|
|
---
|
2014-10-15 18:37:21 +00:00
|
|
|
Network/Socket.hsc | 4 ++--
|
2013-04-19 20:32:16 +00:00
|
|
|
1 file changed, 2 insertions(+), 2 deletions(-)
|
|
|
|
|
|
|
|
diff --git a/Network/Socket.hsc b/Network/Socket.hsc
|
2014-10-15 18:37:21 +00:00
|
|
|
index 2fe62ee..94db7a4 100644
|
2013-04-19 20:32:16 +00:00
|
|
|
--- a/Network/Socket.hsc
|
|
|
|
+++ b/Network/Socket.hsc
|
2014-10-15 18:37:21 +00:00
|
|
|
@@ -511,7 +511,7 @@ accept sock@(MkSocket s family stype protocol status) = do
|
2013-04-19 20:32:16 +00:00
|
|
|
#else
|
|
|
|
with (fromIntegral sz) $ \ ptr_len -> do
|
2014-10-15 18:37:21 +00:00
|
|
|
new_sock <-
|
2013-04-19 20:32:16 +00:00
|
|
|
-# ifdef HAVE_ACCEPT4
|
2013-10-18 20:19:22 +00:00
|
|
|
+#if 0
|
2014-10-15 18:37:21 +00:00
|
|
|
throwSocketErrorIfMinus1RetryMayBlock "accept"
|
2013-04-19 20:32:16 +00:00
|
|
|
(threadWaitRead (fromIntegral s))
|
|
|
|
(c_accept4 s sockaddr ptr_len (#const SOCK_NONBLOCK))
|
2014-10-15 18:37:21 +00:00
|
|
|
@@ -1602,7 +1602,7 @@ foreign import CALLCONV SAFE_ON_WIN "connect"
|
2013-04-19 20:32:16 +00:00
|
|
|
c_connect :: CInt -> Ptr SockAddr -> CInt{-CSockLen???-} -> IO CInt
|
|
|
|
foreign import CALLCONV unsafe "accept"
|
|
|
|
c_accept :: CInt -> Ptr SockAddr -> Ptr CInt{-CSockLen???-} -> IO CInt
|
|
|
|
-#ifdef HAVE_ACCEPT4
|
|
|
|
+#if 0
|
|
|
|
foreign import CALLCONV unsafe "accept4"
|
|
|
|
c_accept4 :: CInt -> Ptr SockAddr -> Ptr CInt{-CSockLen???-} -> CInt -> IO CInt
|
|
|
|
#endif
|
|
|
|
--
|
2014-10-15 18:37:21 +00:00
|
|
|
2.1.1
|
2013-04-19 20:32:16 +00:00
|
|
|
|