From ab9871e71eac6b33ce92a0ad26dc50d0ff241e3b Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Wed, 8 Jun 2005 01:04:30 +0000 Subject: [PATCH] 1882. [port] win32: isc__errno2result() now reports its caller. [RT #13753] 1881. [port] win32: Handle ERROR_NETNAME_DELETED. [RT #13753] --- CHANGES | 5 +++++ lib/isc/win32/errno2result.c | 11 ++++------- lib/isc/win32/errno2result.h | 7 +++++-- lib/isc/win32/socket.c | 4 +++- 4 files changed, 17 insertions(+), 10 deletions(-) diff --git a/CHANGES b/CHANGES index b99118b3b1..ed8b5f8461 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,8 @@ +1882. [port] win32: isc__errno2result() now reports its caller. + [RT #13753] + +1881. [port] win32: Handle ERROR_NETNAME_DELETED. [RT #13753] + 1880. [placeholder] 1879. [func] Added framework for handling multiple EDNS versions. diff --git a/lib/isc/win32/errno2result.c b/lib/isc/win32/errno2result.c index f7873f51ab..8c8c6038e9 100644 --- a/lib/isc/win32/errno2result.c +++ b/lib/isc/win32/errno2result.c @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: errno2result.c,v 1.9 2004/03/05 05:11:56 marka Exp $ */ +/* $Id: errno2result.c,v 1.10 2005/06/08 01:04:29 marka Exp $ */ #include @@ -32,7 +32,7 @@ * not already there. */ isc_result_t -isc__errno2result(int posixerrno) { +isc__errno2resultx(int posixerrno, const char *file, int line) { char strbuf[ISC_STRERRORSIZE]; switch (posixerrno) { @@ -63,10 +63,8 @@ isc__errno2result(int posixerrno) { 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); + 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 @@ -76,4 +74,3 @@ isc__errno2result(int posixerrno) { return (ISC_R_UNEXPECTED); } } - diff --git a/lib/isc/win32/errno2result.h b/lib/isc/win32/errno2result.h index b72dc33cac..75d60b0c96 100644 --- a/lib/isc/win32/errno2result.h +++ b/lib/isc/win32/errno2result.h @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: errno2result.h,v 1.6 2004/03/05 05:11:57 marka Exp $ */ +/* $Id: errno2result.h,v 1.7 2005/06/08 01:04:29 marka Exp $ */ #ifndef UNIX_ERRNO2RESULT_H #define UNIX_ERRNO2RESULT_H 1 @@ -29,8 +29,11 @@ ISC_LANG_BEGINDECLS +#define isc__errno2result(posixerrno) \ + isc__errno2resultx(posixerrno, __FILE__, __LINE__) + isc_result_t -isc__errno2result(int posixerrno); +isc__errno2resultx(int posixerrno, const char *file, int line); ISC_LANG_ENDDECLS diff --git a/lib/isc/win32/socket.c b/lib/isc/win32/socket.c index b7855b7746..65766cca6f 100644 --- a/lib/isc/win32/socket.c +++ b/lib/isc/win32/socket.c @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: socket.c,v 1.37 2005/02/24 00:33:35 marka Exp $ */ +/* $Id: socket.c,v 1.38 2005/06/08 01:04:30 marka Exp $ */ /* This code has been rewritten to take advantage of Windows Sockets * I/O Completion Ports and Events. I/O Completion Ports is ONLY @@ -1385,6 +1385,7 @@ completeio_recv(isc_socket_t *sock, isc_socketevent_t *dev, SOFT_OR_HARD(WSAEDISCON, ISC_R_CONNECTIONRESET); SOFT_OR_HARD(WSAENETDOWN, ISC_R_NETDOWN); ALWAYS_HARD(ERROR_OPERATION_ABORTED, ISC_R_CONNECTIONRESET); + ALWAYS_HARD(ERROR_NETNAME_DELETED, ISC_R_CONNECTIONRESET); ALWAYS_HARD(ERROR_PORT_UNREACHABLE, ISC_R_HOSTUNREACH); ALWAYS_HARD(ERROR_HOST_UNREACHABLE, ISC_R_HOSTUNREACH); ALWAYS_HARD(ERROR_NETWORK_UNREACHABLE, ISC_R_NETUNREACH); @@ -1572,6 +1573,7 @@ completeio_send(isc_socket_t *sock, isc_socketevent_t *dev, SOFT_OR_HARD(WSAEDISCON, ISC_R_CONNECTIONRESET); SOFT_OR_HARD(WSAENETDOWN, ISC_R_NETDOWN); ALWAYS_HARD(ERROR_OPERATION_ABORTED, ISC_R_CONNECTIONRESET); + ALWAYS_HARD(ERROR_NETNAME_DELETED, ISC_R_CONNECTIONRESET); ALWAYS_HARD(ERROR_PORT_UNREACHABLE, ISC_R_HOSTUNREACH); ALWAYS_HARD(ERROR_HOST_UNREACHABLE, ISC_R_HOSTUNREACH); ALWAYS_HARD(ERROR_NETWORK_UNREACHABLE, ISC_R_NETUNREACH); -- GitLab