Commit 28d8b411 authored by Mark Andrews's avatar Mark Andrews
Browse files

1200. [bug] Log 'errno' that we are unable to convert to

                       isc_result_t. [RT #2404]
parent d6c0627d
1200. [bug] Log 'errno' that we are unable to convert to
isc_result_t. [RT #2404]
1199. [doc] ARM reference to RFC 2157 should have been RFC 1918.
[RT #2436]
......
......@@ -15,11 +15,13 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: errno2result.c,v 1.8 2001/06/15 22:07:49 gson Exp $ */
/* $Id: errno2result.c,v 1.9 2002/02/11 05:11:06 marka Exp $ */
#include <config.h>
#include <isc/result.h>
#include <isc/strerror.h>
#include <isc/util.h>
#include "errno2result.h"
......@@ -31,6 +33,8 @@
*/
isc_result_t
isc__errno2result(int posixerrno) {
char strbuf[ISC_STRERRORSIZE];
switch (posixerrno) {
case ENOTDIR:
case ELOOP:
......@@ -97,6 +101,11 @@ isc__errno2result(int posixerrno) {
return (ISC_R_ADDRINUSE);
#endif
default:
isc__strerror(posixerrno, strbuf, sizeof(strbuf));
UNEXPECTED_ERROR(__FILE__, __LINE__,
"unable to convert errno "
"to isc_result: %d: %s",
posixerrno, strbuf);
/*
* XXXDCL would be nice if perhaps this function could
* return the system's error string, so the caller
......
......@@ -15,13 +15,15 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: errno2result.c,v 1.5 2001/09/04 03:22:17 mayer Exp $ */
/* $Id: errno2result.c,v 1.6 2002/02/11 05:11:04 marka Exp $ */
#include <config.h>
#include <winsock2.h>
#include "errno2result.h"
#include <isc/result.h>
#include <isc/strerror.h>
#include <isc/util.h>
/*
* Convert a POSIX errno value into an isc_result_t. The
......@@ -31,6 +33,8 @@
*/
isc_result_t
isc__errno2result(int posixerrno) {
char strbuf[ISC_STRERRORSIZE];
switch (posixerrno) {
case ENOTDIR:
case WSAELOOP:
......@@ -53,6 +57,11 @@ isc__errno2result(int posixerrno) {
case EMFILE:
return (ISC_R_TOOMANYOPENFILES);
default:
isc__strerror(posixerrno, strbuf, sizeof(strbuf));
UNEXPECTED_ERROR(__FILE__, __LINE__,
"unable to convert errno "
"to isc_result: %d: %s",
posixerrno, strbuf);
/*
* XXXDCL would be nice if perhaps this function could
* return the system's error string, so the caller
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment