summaryrefslogtreecommitdiff
path: root/editors/libreoffice/files/patch-sal_osl_unx_socket.cxx
blob: f9ae9ceff0a85c9432263153c3513b4b2e6fd758 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
--- sal/osl/unx/socket.cxx.orig	2015-12-11 02:29:35 UTC
+++ sal/osl/unx/socket.cxx
@@ -447,7 +447,7 @@ oslSocket __osl_createSocketImpl(int Soc
     pSocket->m_nLastError = 0;
     pSocket->m_nRefCount = 1;
 
-#if defined(LINUX)
+#if CLOSESOCKET_DOESNT_WAKE_UP_ACCEPT
     pSocket->m_bIsAccepting = false;
 #endif
 
@@ -1364,13 +1364,13 @@ void SAL_CALL osl_releaseSocket( oslSock
 {
     if( pSocket && 0 == osl_atomic_decrement( &(pSocket->m_nRefCount) ) )
     {
-#if defined(LINUX)
+#if CLOSESOCKET_DOESNT_WAKE_UP_ACCEPT
     if ( pSocket->m_bIsAccepting )
     {
         SAL_WARN( "sal.osl", "attempt to destroy socket while accepting" );
         return;
     }
-#endif /* LINUX */
+#endif /* CLOSESOCKET_DOESNT_WAKE_UP_ACCEPT */
         osl_closeSocket( pSocket );
         __osl_destroySocketImpl( pSocket );
     }
@@ -1393,7 +1393,7 @@ void SAL_CALL osl_closeSocket(oslSocket 
 
     pSocket->m_Socket = OSL_INVALID_SOCKET;
 
-#if defined(LINUX)
+#if CLOSESOCKET_DOESNT_WAKE_UP_ACCEPT
     pSocket->m_bIsInShutdown = true;
 
     if ( pSocket->m_bIsAccepting )
@@ -1437,7 +1437,7 @@ void SAL_CALL osl_closeSocket(oslSocket 
         }
         pSocket->m_bIsAccepting = false;
     }
-#endif /* LINUX */
+#endif /* CLOSESOCKET_DOESNT_WAKE_UP_ACCEPT */
 
     nRet=close(nFD);
     if ( nRet != 0 )
@@ -1695,9 +1695,9 @@ oslSocket SAL_CALL osl_acceptConnectionO
     }
 
     pSocket->m_nLastError=0;
-#if defined(LINUX)
+#if CLOSESOCKET_DOESNT_WAKE_UP_ACCEPT
     pSocket->m_bIsAccepting = true;
-#endif /* LINUX */
+#endif /* CLOSESOCKET_DOESNT_WAKE_UP_ACCEPT */
 
     if( ppAddr && *ppAddr )
     {
@@ -1718,22 +1718,22 @@ oslSocket SAL_CALL osl_acceptConnectionO
         int nErrno = errno;
         SAL_WARN( "sal.osl", "accept connection failed: (" << nErrno << ") " << strerror(nErrno) );
 
-#if defined(LINUX)
+#if CLOSESOCKET_DOESNT_WAKE_UP_ACCEPT
         pSocket->m_bIsAccepting = false;
-#endif /* LINUX */
+#endif /* CLOSESOCKET_DOESNT_WAKE_UP_ACCEPT */
         return 0;
     }
 
     assert(AddrLen == sizeof(struct sockaddr));
 
-#if defined(LINUX)
+#if CLOSESOCKET_DOESNT_WAKE_UP_ACCEPT
     if ( pSocket->m_bIsInShutdown )
     {
         close(Connection);
         SAL_WARN( "sal.osl", "close while accept" );
         return 0;
     }
-#endif /* LINUX */
+#endif /* CLOSESOCKET_DOESNT_WAKE_UP_ACCEPT */
 
     if(ppAddr)
     {
@@ -1758,11 +1758,11 @@ oslSocket SAL_CALL osl_acceptConnectionO
 
     pConnectionSockImpl->m_Socket           = Connection;
     pConnectionSockImpl->m_nLastError       = 0;
-#if defined(LINUX)
+#if CLOSESOCKET_DOESNT_WAKE_UP_ACCEPT
     pConnectionSockImpl->m_bIsAccepting     = false;
 
     pSocket->m_bIsAccepting = false;
-#endif /* LINUX */
+#endif /* CLOSESOCKET_DOESNT_WAKE_UP_ACCEPT */
     return pConnectionSockImpl;
 }