diff options
author | Yang Tse <yangsita@gmail.com> | 2007-02-16 19:17:05 +0000 |
---|---|---|
committer | Yang Tse <yangsita@gmail.com> | 2007-02-16 19:17:05 +0000 |
commit | 8595ddf7c49ab6d73345ba682a58455ad849f39c (patch) | |
tree | 26ebe36693ba532ffb67914013226fb581354120 /ares_search.c | |
parent | 69fa44735497e10ca7c49075455da1370b7d7484 (diff) | |
download | c-ares-8595ddf7c49ab6d73345ba682a58455ad849f39c.tar.gz c-ares-8595ddf7c49ab6d73345ba682a58455ad849f39c.tar.bz2 c-ares-8595ddf7c49ab6d73345ba682a58455ad849f39c.zip |
add debug messages for fopen() failures
Diffstat (limited to 'ares_search.c')
-rw-r--r-- | ares_search.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/ares_search.c b/ares_search.c index b05b4a8..e63afff 100644 --- a/ares_search.c +++ b/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; + } + } } } |