errno2result now reports caller when unable to convert errno
This commit is contained in:
@@ -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.18 2011/12/02 07:15:17 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);
|
||||
/*
|
||||
|
||||
@@ -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.13 2011/12/02 07:15:17 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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user