From 57392076404f37e65fe63e292a6f145bb65f20e7 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Tue, 15 Jul 2008 03:26:53 +0000 Subject: [PATCH] better nat-pmp error logging. (this will very briefly break the mac build) --- libtransmission/natpmp.c | 5 ++++- third-party/libnatpmp/Makefile.am | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/libtransmission/natpmp.c b/libtransmission/natpmp.c index c18cfe2a6..529f35078 100644 --- a/libtransmission/natpmp.c +++ b/libtransmission/natpmp.c @@ -21,6 +21,7 @@ #include /* inet_ntoa */ #endif +#define ENABLE_STRNATPMPERR #include #include "transmission.h" @@ -69,7 +70,9 @@ logVal( const char * func, int ret ) 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 ); + tr_ndbg( getKey(), "%s failed. natpmp returned %d (%s); errno is %d (%s)", + func, ret, strnatpmperr(ret), errno, tr_strerror(errno) ); + } struct tr_natpmp* diff --git a/third-party/libnatpmp/Makefile.am b/third-party/libnatpmp/Makefile.am index 3fca7d53c..923ab169d 100644 --- a/third-party/libnatpmp/Makefile.am +++ b/third-party/libnatpmp/Makefile.am @@ -1,5 +1,7 @@ noinst_LIBRARIES = libnatpmp.a +AM_CPPFLAGS = -DENABLE_STRNATPMPERR + libnatpmp_a_SOURCES = \ getgateway.c \ natpmp.c