Bläddra i källkod

Set nosigpipe socket option on platforms that send sigpipes in coroipcc.

git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2273 fd59a12c-fef9-0310-b244-a6a79926bd2f
Steven Dake 16 år sedan
förälder
incheckning
ea5d3ba241
1 ändrade filer med 4 tillägg och 1 borttagningar
  1. 4 1
      lib/coroipcc.c

+ 4 - 1
lib/coroipcc.c

@@ -94,7 +94,7 @@ DECLARE_HDB_DATABASE(ipc_hdb,ipc_hdb_destructor);
 #endif
 #endif
 
 
 #ifdef SO_NOSIGPIPE
 #ifdef SO_NOSIGPIPE
-void socket_nosigpipe(int s)
+static void socket_nosigpipe(int s)
 {
 {
 	int on = 1;
 	int on = 1;
 	setsockopt(s, SOL_SOCKET, SO_NOSIGPIPE, (void *)&on, sizeof(on));
 	setsockopt(s, SOL_SOCKET, SO_NOSIGPIPE, (void *)&on, sizeof(on));
@@ -546,6 +546,9 @@ coroipcc_service_connect (
 	if (request_fd == -1) {
 	if (request_fd == -1) {
 		return (CS_ERR_LIBRARY);
 		return (CS_ERR_LIBRARY);
 	}
 	}
+#ifdef SO_NOSIGPIPE
+	socket_nosigpipe (request_fd);
+#endif
 
 
 	memset (&address, 0, sizeof (struct sockaddr_un));
 	memset (&address, 0, sizeof (struct sockaddr_un));
 	address.sun_family = AF_UNIX;
 	address.sun_family = AF_UNIX;