freebsd-ports/devel/ice/files/patch-cpp-src-Ice-Network.cpp
Tilman Keskinoz 728b894f6d Fix a compatibility issue with FreeBSD's implementation of close(2) which
results in Ice reporting errno ECONNRESET (connection reset by peer).

PR:		159031
Submitted by:	Michael Gmelin <freebsd@grem.de>
Approved by:	maintainer
2011-07-31 15:43:29 +00:00

15 lines
461 B
C++

--- cpp.orig/src/Ice/Network.cpp 2011-06-15 21:43:58.000000000 +0200
+++ cpp/src/Ice/Network.cpp 2011-07-15 23:40:26.000000000 +0200
@@ -715,7 +715,11 @@
WSASetLastError(error);
#else
int error = errno;
- if(close(fd) == SOCKET_ERROR)
+ if(close(fd) == SOCKET_ERROR
+# if defined(__FreeBSD__)
+ && getSocketErrno() != ECONNRESET
+# endif
+ )
{
SocketException ex(__FILE__, __LINE__);
ex.error = getSocketErrno();