[v9_9] isc_errno_toresult()
4445. [cleanup] isc_errno_toresult() can now be used to call the
formerly private function isc__errno2result().
[RT #43050]
(cherry picked from commit ddef16e1d9)
This commit is contained in:
@@ -32,7 +32,9 @@
|
||||
* not already there.
|
||||
*/
|
||||
isc_result_t
|
||||
isc__errno2resultx(int posixerrno, const char *file, int line) {
|
||||
isc__errno2resultx(int posixerrno, isc_boolean_t dolog,
|
||||
const char *file, int line)
|
||||
{
|
||||
char strbuf[ISC_STRERRORSIZE];
|
||||
|
||||
switch (posixerrno) {
|
||||
@@ -99,9 +101,13 @@ isc__errno2resultx(int posixerrno, const char *file, int line) {
|
||||
case WSAENOBUFS:
|
||||
return (ISC_R_NORESOURCES);
|
||||
default:
|
||||
isc__strerror(posixerrno, strbuf, sizeof(strbuf));
|
||||
UNEXPECTED_ERROR(file, line, "unable to convert errno "
|
||||
"to isc_result: %d: %s", posixerrno, strbuf);
|
||||
if (dolog) {
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user