You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo-overlay/app-misc/sphinx/files/sphinx-1.10_beta-nosigpipe....

27 lines
790 B

Part of upstream fix:
http://code.google.com/p/sphinxsearch/source/detail?r=2423
--- api/libsphinxclient/sphinxclient.c.~1~ 2010-07-15 13:05:40.000000000 +0200
+++ api/libsphinxclient/sphinxclient.c 2010-11-09 19:55:28.964939046 +0100
@@ -1268,7 +1268,11 @@
static sphinx_bool net_write ( int fd, const char * bytes, int len, sphinx_client * client )
{
int res;
+#if defined(_WIN32) || defined(SO_NOSIGPIPE)
res = send ( fd, bytes, len, 0 );
+#else
+ res = send ( fd, bytes, len, MSG_NOSIGNAL );
+#endif
if ( res<0 )
{
@@ -1354,7 +1358,7 @@
}
optval = 1;
-#ifndef _WIN32
+#if defined(SO_NOSIGPIPE)
if ( setsockopt ( sock, SOL_SOCKET, SO_NOSIGPIPE, (void *)&optval, (socklen_t)sizeof(optval) ) < 0 )
{
set_error ( client, "setsockopt() failed: %s", sock_error() );