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

Merge trunk revision 2740:
r2740 | jflesch | 2010-03-26 06:54:42 -0700 (Fri, 26 Mar 2010) | 1 line

Totemudp: Add debug logs when a call to sendmsg() fails



git-svn-id: http://svn.fedorahosted.org/svn/corosync/branches/flatiron@2773 fd59a12c-fef9-0310-b244-a6a79926bd2f

Steven Dake 16 лет назад
Родитель
Сommit
8b31be1a50
1 измененных файлов с 19 добавлено и 1 удалено
  1. 19 1
      exec/totemudp.c

+ 19 - 1
exec/totemudp.c

@@ -952,11 +952,17 @@ static inline void ucast_sendmsg (
 
 
 
 
 	/*
 	/*
-	 * Transmit multicast message
+	 * Transmit unicast message
 	 * An error here is recovered by totemsrp
 	 * An error here is recovered by totemsrp
 	 */
 	 */
 	res = sendmsg (instance->totemudp_sockets.mcast_send, &msg_ucast,
 	res = sendmsg (instance->totemudp_sockets.mcast_send, &msg_ucast,
 		MSG_NOSIGNAL);
 		MSG_NOSIGNAL);
+	if (res < 0) {
+		char error_str[100];
+		strerror_r (errno, error_str, sizeof(error_str));
+		log_printf (instance->totemudp_log_level_debug,
+				"sendmsg(ucast) failed (non-critical): %s\n", error_str);
+	}
 }
 }
 
 
 static inline void mcast_sendmsg (
 static inline void mcast_sendmsg (
@@ -1036,6 +1042,12 @@ static inline void mcast_sendmsg (
 	 */
 	 */
 	res = sendmsg (instance->totemudp_sockets.mcast_send, &msg_mcast,
 	res = sendmsg (instance->totemudp_sockets.mcast_send, &msg_mcast,
 		MSG_NOSIGNAL);
 		MSG_NOSIGNAL);
+	if (res < 0) {
+		char error_str[100];
+		strerror_r (errno, error_str, sizeof(error_str));
+		log_printf (instance->totemudp_log_level_debug,
+				"sendmsg(mcast) failed (non-critical): %s\n", error_str);
+	}
 }
 }
 
 
 static void totemudp_mcast_thread_state_constructor (
 static void totemudp_mcast_thread_state_constructor (
@@ -1110,6 +1122,12 @@ static void totemudp_mcast_worker_fn (void *thread_state, void *work_item_in)
 	 */
 	 */
 	res = sendmsg (instance->totemudp_sockets.mcast_send, &msg_mcast,
 	res = sendmsg (instance->totemudp_sockets.mcast_send, &msg_mcast,
 		MSG_NOSIGNAL);
 		MSG_NOSIGNAL);
+	if (res < 0) {
+		char error_str[100];
+		strerror_r (errno, error_str, sizeof(error_str));
+		log_printf (instance->totemudp_log_level_debug,
+				"sendmsg(mcast) failed (non-critical): %s\n", error_str);
+	}
 }
 }
 
 
 int totemudp_finalize (
 int totemudp_finalize (