aboutsummaryrefslogtreecommitdiff
path: root/ares/ares_search.c
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2007-02-16 19:17:05 +0000
committerYang Tse <yangsita@gmail.com>2007-02-16 19:17:05 +0000
commit4dc453c08796da93eaa82a0af36029c265893300 (patch)
tree475eaec57058a81efce9032501b6236e64ee6846 /ares/ares_search.c
parenta1d598399146984c99baa46db148e87c75261033 (diff)
add debug messages for fopen() failures
Diffstat (limited to 'ares/ares_search.c')
-rw-r--r--ares/ares_search.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/ares/ares_search.c b/ares/ares_search.c
index b05b4a833..e63afff05 100644
--- a/ares/ares_search.c
+++ b/ares/ares_search.c
@@ -216,6 +216,7 @@ static int single_domain(ares_channel channel, const char *name, char **s)
char *line = NULL;
int linesize, status;
const char *p, *q;
+ int error;
/* If the name contains a trailing dot, then the single query is the name
* sans the trailing dot.
@@ -265,6 +266,22 @@ static int single_domain(ares_channel channel, const char *name, char **s)
if (status != ARES_SUCCESS)
return status;
}
+ else
+ {
+ error = ERRNO;
+ switch(error)
+ {
+ case ENOENT:
+ break;
+ default:
+ DEBUGF(fprintf(stderr, "fopen() failed with error: %d %s\n",
+ error, strerror(error)));
+ DEBUGF(fprintf(stderr, "Error opening file: %s\n",
+ hostaliases));
+ *s = NULL;
+ return ARES_EFILE;
+ }
+ }
}
}