Commit 35921f41 authored by Michael Graff's avatar Michael Graff
Browse files

Add ISC_R_NORESOURCES, and redo where and how the last entry is set

parent 7b5e3afd
......@@ -17,6 +17,9 @@ typedef unsigned int isc_result_t;
#define ISC_R_NETDOWN 10
#define ISC_R_HOSTDOWN 11
#define ISC_R_CONNREFUSED 12
#define ISC_R_NORESOURCES 13 /* not enough resources */
#define ISC_R_LAST_ENTRY 13 /* last entry in the file */
#define ISC_R_UNEXPECTED 0xFFFFFFFFL
#define isc_result_totext __isc_result_totext
......
#include <isc/result.h>
#define LAST_ENTRY ISC_R_CONNREFUSED
static char *text_table[LAST_ENTRY+1] = {
static char *text_table[ISC_R_LAST_ENTRY + 1] = {
"success",
"out of memory",
"timed out",
......@@ -17,13 +15,14 @@ static char *text_table[LAST_ENTRY+1] = {
"network down",
"host down",
"connection refused",
"not enough free resources",
};
char *
isc_result_totext(isc_result_t result) {
if (result == ISC_R_UNEXPECTED)
return ("unexpected error");
if (result > LAST_ENTRY)
if (result > ISC_R_LAST_ENTRY)
return ("unknown result code");
return (text_table[result]);
}
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