Add ISC_R_NORESOURCES, and redo where and how the last entry is set
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
|
||||
#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]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user