From: Mark Andrews Date: Fri, 2 Dec 2011 07:16:30 +0000 (+0000) Subject: errno2result now reports caller when unable to convert errno X-Git-Tag: v9.7.5b1~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3335f10b815264c10e986b3ea05d725d52847261;p=thirdparty%2Fbind9.git errno2result now reports caller when unable to convert errno --- diff --git a/lib/isc/unix/errno2result.c b/lib/isc/unix/errno2result.c index 606c5600c2f..88966208dbf 100644 --- a/lib/isc/unix/errno2result.c +++ b/lib/isc/unix/errno2result.c @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: errno2result.c,v 1.17 2007/06/19 23:47:18 tbox Exp $ */ +/* $Id: errno2result.c,v 1.17.558.1 2011/12/02 07:16:29 marka Exp $ */ /*! \file */ @@ -34,7 +34,7 @@ * not already there. */ isc_result_t -isc__errno2result(int posixerrno) { +isc___errno2result(int posixerrno, const char *file, unsigned int line) { char strbuf[ISC_STRERRORSIZE]; switch (posixerrno) { @@ -108,8 +108,7 @@ isc__errno2result(int posixerrno) { return (ISC_R_CONNREFUSED); default: isc__strerror(posixerrno, strbuf, sizeof(strbuf)); - UNEXPECTED_ERROR(__FILE__, __LINE__, - "unable to convert errno " + UNEXPECTED_ERROR(file, line, "unable to convert errno " "to isc_result: %d: %s", posixerrno, strbuf); /* diff --git a/lib/isc/unix/errno2result.h b/lib/isc/unix/errno2result.h index b5b658d500c..f39c3fb7048 100644 --- a/lib/isc/unix/errno2result.h +++ b/lib/isc/unix/errno2result.h @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: errno2result.h,v 1.12 2007/06/19 23:47:18 tbox Exp $ */ +/* $Id: errno2result.h,v 1.12.558.1 2011/12/02 07:16:30 marka Exp $ */ #ifndef UNIX_ERRNO2RESULT_H #define UNIX_ERRNO2RESULT_H 1 @@ -31,8 +31,10 @@ ISC_LANG_BEGINDECLS +#define isc__errno2result(x) isc___errno2result(x, __FILE__, __LINE__) + isc_result_t -isc__errno2result(int posixerrno); +isc___errno2result(int posixerrno, const char *file, unsigned int line); ISC_LANG_ENDDECLS