Sfoglia il codice sorgente

Handle SIGPIPE in req_setup_send

When IPC client exits exactly when req_setup_send function calls send,
SIGPIPE is generated and corosync (because SIGPIPE is not handled)
exits. Solution is to use MSG_NOSIGNAL as flag.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Jan Friesse 12 anni fa
parent
commit
a9c4bbd9f1
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  1. 1 1
      exec/coroipcs.c

+ 1 - 1
exec/coroipcs.c

@@ -761,7 +761,7 @@ req_setup_send (
 	res_setup.error = error;
 	res_setup.error = error;
 
 
 retry_send:
 retry_send:
-	res = send (conn_info->fd, &res_setup, sizeof (mar_res_setup_t), MSG_WAITALL);
+	res = send (conn_info->fd, &res_setup, sizeof (mar_res_setup_t), MSG_WAITALL|MSG_NOSIGNAL);
 	if (res == -1 && errno == EINTR) {
 	if (res == -1 && errno == EINTR) {
 		api->stats_increment_value (conn_info->stats_handle, "send_retry_count");
 		api->stats_increment_value (conn_info->stats_handle, "send_retry_count");
 		goto retry_send;
 		goto retry_send;