From 7f89ee3db250a414bfc82b356e58bf04e6756edc Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Mon, 14 Apr 2008 20:06:37 +0000 Subject: [PATCH] silence a couple of annoying dbg messages --- libtransmission/bencode.c | 11 ++++++----- libtransmission/natpmp.c | 6 +++--- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/libtransmission/bencode.c b/libtransmission/bencode.c index e09b3747d..856c02f40 100644 --- a/libtransmission/bencode.c +++ b/libtransmission/bencode.c @@ -1067,7 +1067,7 @@ tr_bencSaveAsSerializedPHP( const tr_benc * top, int * len ) int tr_bencSaveFile( const char * filename, const tr_benc * b ) { - int ret = TR_OK; + int err = TR_OK; int len; char * content = tr_bencSave( b, &len ); FILE * out = NULL; @@ -1077,20 +1077,21 @@ tr_bencSaveFile( const char * filename, const tr_benc * b ) { tr_err( _( "Couldn't open \"%1$s\": %2$s" ), filename, tr_strerror( errno ) ); - ret = TR_EINVALID; + err = TR_EINVALID; } else if( fwrite( content, sizeof( char ), len, out ) != (size_t)len ) { tr_err( _( "Couldn't save file \"%1$s\": %2$s" ), filename, tr_strerror( errno ) ); - ret = TR_EINVALID; + err = TR_EINVALID; } - tr_dbg( "tr_bencSaveFile returned %d when saving \"%s\"", ret, filename ); + if( !err ) + tr_dbg( "tr_bencSaveFile saved \"%s\"", filename ); tr_free( content ); if( out ) fclose( out ); - return ret; + return err; } int diff --git a/libtransmission/natpmp.c b/libtransmission/natpmp.c index aec002054..5b1651c46 100644 --- a/libtransmission/natpmp.c +++ b/libtransmission/natpmp.c @@ -64,9 +64,9 @@ struct tr_natpmp static void logVal( const char * func, int ret ) { - if( ret==NATPMP_TRYAGAIN ) - tr_ndbg( getKey(), "%s responded \"try again\"", func ); - else if( ret >= 0 ) + if( ret == NATPMP_TRYAGAIN ) + return; + if( ret >= 0 ) tr_ninf( getKey(), _( "%s succeeded (%d)" ), func, ret ); else tr_ndbg( getKey(), "%s failed (%d): %s (%d)", func, ret, tr_strerror(errno), errno );