From b4a513ce87cba9472ec81cfd12e5e6cf391adb78 Mon Sep 17 00:00:00 2001 From: Eric House Date: Wed, 29 Jun 2011 21:38:31 -0700 Subject: [PATCH] reduce logging; log errno on syscall failure --- xwords4/relay/xwrelay.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/xwords4/relay/xwrelay.cpp b/xwords4/relay/xwrelay.cpp index 0aec6985f..c7615875c 100644 --- a/xwords4/relay/xwrelay.cpp +++ b/xwords4/relay/xwrelay.cpp @@ -185,7 +185,6 @@ parseRelayID( const char* const in, char* buf, HostID* hid ) strncpy( buf, in, connNameLen ); buf[connNameLen] = '\0'; *hid = atoi( hidp+1 ); - logf( XW_LOGINFO, "%s(%s)=>%s : %d", __func__, in, buf, *hid ); } return ok; } @@ -864,9 +863,15 @@ set_timeouts( int sock ) tv.tv_usec = 0; /* microseconds */ result = setsockopt( sock, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof(tv) ); - assert( 0 == result ); + if ( 0 != result ) { + logf( XW_LOGERROR, "setsockopt=>%d (%s)", errno, strerror(errno) ); + assert( 0 ); + } result = setsockopt( sock, SOL_SOCKET, SO_SNDTIMEO, &tv, sizeof(tv) ); - assert( 0 == result ); + if ( 0 != result ) { + logf( XW_LOGERROR, "setsockopt=>%d (%s)", errno, strerror(errno) ); + assert( 0 ); + } } int