Просмотр исходного кода

Fix IPC when running on mac OS/X

Note that OS/X seems to be rather stingy about its IPC resources, so if things
crash you will probably have to clean up before starting it all again.



git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1911 fd59a12c-fef9-0310-b244-a6a79926bd2f
Christine Caulfield 17 лет назад
Родитель
Сommit
200fe649c7
2 измененных файлов с 5 добавлено и 2 удалено
  1. 2 2
      exec/coroipcs.c
  2. 3 0
      exec/main.c

+ 2 - 2
exec/coroipcs.c

@@ -72,7 +72,7 @@
 #include "coroipcs.h"
 #include <corosync/ipc_gen.h>
 
-#ifdef COROSYNC_SOLARIS
+#ifndef MSG_NOSIGNAL
 #define MSG_NOSIGNAL 0
 #endif
 
@@ -399,9 +399,9 @@ req_setup_recv (
 
 #endif
 
-#ifdef COROSYNC_LINUX
 	iov_recv.iov_base = &conn_info->setup_msg[conn_info->setup_bytes_read];
 	iov_recv.iov_len = sizeof (mar_req_setup_t) - conn_info->setup_bytes_read;
+#ifdef COROSYNC_LINUX
 	setsockopt(conn_info->fd, SOL_SOCKET, SO_PASSCRED, &on, sizeof (on));
 #endif
 

+ 3 - 0
exec/main.c

@@ -724,6 +724,9 @@ int main (int argc, char **argv)
 	(void)signal (SIGSEGV, sigsegv_handler);
 	(void)signal (SIGABRT, sigabrt_handler);
 	(void)signal (SIGQUIT, sigquit_handler);
+#if MSG_NOSIGNAL == 0
+	(void)signal (SIGPIPE, SIG_IGN);
+#endif
 	
 	corosync_timer_init (
 		serialize_lock,