[Libreoffice-commits] core.git: sal/osl
Damjan Jovanovic
damjan at apache.org
Sun Feb 7 20:27:43 UTC 2016
sal/osl/unx/pipe.cxx | 14 +++++++-------
sal/osl/unx/sockimpl.hxx | 2 +-
2 files changed, 8 insertions(+), 8 deletions(-)
New commits:
commit ed983eb5ce71d0b9af07795eabd8686f24c4597e
Author: Damjan Jovanovic <damjan at apache.org>
Date: Sat Feb 6 19:07:51 2016 +0000
Platforms that need CLOSESOCKET_DOESNT_WAKE_UP_ACCEPT for sockets usually
need it for pipes too, and even if it isn't necessary it can't hurt.
In particular, on FreeBSD 11-CURRENT it seems pipes no longer wake up
from accept when closed in other threads, so let's deal with that before
FreeBSD 11 is released.
Reported by: Matthias Apitz <g u r u a t u n i x a r e a d o t d e>
Patch by: me
Tested by: Matthias Apitz <g u r u a t u n i x a r e a d o t d e>
(cherry picked from commit e18ecd4f644cfbe5d6b871c7ff6c76bd5c220504)
Change-Id: I1b4c0438fbcc2ea53625f235906936fc1403e195
diff --git a/sal/osl/unx/pipe.cxx b/sal/osl/unx/pipe.cxx
index b598ddc..9321395 100644
--- a/sal/osl/unx/pipe.cxx
+++ b/sal/osl/unx/pipe.cxx
@@ -82,7 +82,7 @@ oslPipe __osl_createPipeImpl()
return nullptr;
pPipeImpl->m_nRefCount =1;
pPipeImpl->m_bClosed = false;
-#if defined(LINUX)
+#if defined(CLOSESOCKET_DOESNT_WAKE_UP_ACCEPT)
pPipeImpl->m_bIsInShutdown = false;
pPipeImpl->m_bIsAccepting = false;
#endif
@@ -359,7 +359,7 @@ void SAL_CALL osl_closePipe( oslPipe pPipe )
Thread does not return from accept on linux, so
connect to the accepting pipe
*/
-#if defined(LINUX)
+#if defined(CLOSESOCKET_DOESNT_WAKE_UP_ACCEPT)
struct sockaddr_un addr;
if ( pPipe->m_bIsAccepting )
@@ -387,7 +387,7 @@ void SAL_CALL osl_closePipe( oslPipe pPipe )
}
close(fd);
}
-#endif /* LINUX */
+#endif /* CLOSESOCKET_DOESNT_WAKE_UP_ACCEPT */
nRet = shutdown(ConnFD, 2);
if ( nRet < 0 )
@@ -421,13 +421,13 @@ oslPipe SAL_CALL osl_acceptPipe(oslPipe pPipe)
OSL_ASSERT(strlen(pPipe->m_Name) > 0);
-#if defined(LINUX)
+#if defined(CLOSESOCKET_DOESNT_WAKE_UP_ACCEPT)
pPipe->m_bIsAccepting = true;
#endif
s = accept(pPipe->m_Socket, nullptr, nullptr);
-#if defined(LINUX)
+#if defined(CLOSESOCKET_DOESNT_WAKE_UP_ACCEPT)
pPipe->m_bIsAccepting = false;
#endif
@@ -437,13 +437,13 @@ oslPipe SAL_CALL osl_acceptPipe(oslPipe pPipe)
return nullptr;
}
-#if defined(LINUX)
+#if defined(CLOSESOCKET_DOESNT_WAKE_UP_ACCEPT)
if ( pPipe->m_bIsInShutdown )
{
close(s);
return nullptr;
}
-#endif /* LINUX */
+#endif /* CLOSESOCKET_DOESNT_WAKE_UP_ACCEPT */
else
{
/* alloc memory */
diff --git a/sal/osl/unx/sockimpl.hxx b/sal/osl/unx/sockimpl.hxx
index 900155c..0b702c6 100644
--- a/sal/osl/unx/sockimpl.hxx
+++ b/sal/osl/unx/sockimpl.hxx
@@ -48,7 +48,7 @@ struct oslPipeImpl {
sal_Char m_Name[PATH_MAX + 1];
oslInterlockedCount m_nRefCount;
bool m_bClosed;
-#if defined(LINUX)
+#if defined(CLOSESOCKET_DOESNT_WAKE_UP_ACCEPT)
bool m_bIsAccepting;
bool m_bIsInShutdown;
#endif
More information about the Libreoffice-commits
mailing list