From a5f27332118660904e27a10fa8d8eebee1f98bcc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=E9r=F4me=20Flesch?= Date: Fri, 26 Mar 2010 13:54:42 +0000 Subject: [PATCH] Totemudp: Add debug logs when a call to sendmsg() fails git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2740 fd59a12c-fef9-0310-b244-a6a79926bd2f --- exec/totemudp.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/exec/totemudp.c b/exec/totemudp.c index 33c543c3..15006c35 100644 --- a/exec/totemudp.c +++ b/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 */ res = sendmsg (instance->totemudp_sockets.mcast_send, &msg_ucast, 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 ( @@ -1036,6 +1042,12 @@ static inline void mcast_sendmsg ( */ res = sendmsg (instance->totemudp_sockets.mcast_send, &msg_mcast, 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 ( @@ -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, 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 (