diff options
Diffstat (limited to 'ares')
-rw-r--r-- | ares/ares_gethostbyaddr.c | 1 | ||||
-rw-r--r-- | ares/ares_gethostbyname.c | 19 | ||||
-rw-r--r-- | ares/ares_init.c | 4 | ||||
-rw-r--r-- | ares/ares_search.c | 1 |
4 files changed, 23 insertions, 2 deletions
diff --git a/ares/ares_gethostbyaddr.c b/ares/ares_gethostbyaddr.c index 0faeaec2a..db0ac46b3 100644 --- a/ares/ares_gethostbyaddr.c +++ b/ares/ares_gethostbyaddr.c @@ -224,6 +224,7 @@ static int file_lookup(union ares_addr *addr, int family, struct hostent **host) switch(error) { case ENOENT: + case ESRCH: return ARES_ENOTFOUND; default: DEBUGF(fprintf(stderr, "fopen() failed with error: %d %s\n", diff --git a/ares/ares_gethostbyname.c b/ares/ares_gethostbyname.c index 00d78861d..1bd5ac95d 100644 --- a/ares/ares_gethostbyname.c +++ b/ares/ares_gethostbyname.c @@ -248,6 +248,7 @@ static int file_lookup(const char *name, int family, struct hostent **host) FILE *fp; char **alias; int status; + int error; #ifdef WIN32 char PATH_HOSTS[MAX_PATH]; @@ -280,8 +281,22 @@ static int file_lookup(const char *name, int family, struct hostent **host) fp = fopen(PATH_HOSTS, "r"); if (!fp) - return ARES_ENOTFOUND; - + { + error = ERRNO; + switch(error) + { + case ENOENT: + case ESRCH: + return ARES_ENOTFOUND; + default: + DEBUGF(fprintf(stderr, "fopen() failed with error: %d %s\n", + error, strerror(error))); + DEBUGF(fprintf(stderr, "Error opening file: %s\n", + PATH_HOSTS)); + *host = NULL; + return ARES_EFILE; + } + } while ((status = ares__get_hostent(fp, family, host)) == ARES_SUCCESS) { if (strcasecmp((*host)->h_name, name) == 0) diff --git a/ares/ares_init.c b/ares/ares_init.c index 5268745d0..8f78fa445 100644 --- a/ares/ares_init.c +++ b/ares/ares_init.c @@ -639,6 +639,7 @@ DhcpNameServer error = ERRNO; switch(error) { case ENOENT: + case ESRCH: status = ARES_EOF; break; default: @@ -664,6 +665,7 @@ DhcpNameServer error = ERRNO; switch(error) { case ENOENT: + case ESRCH: status = ARES_EOF; break; default: @@ -690,6 +692,7 @@ DhcpNameServer error = ERRNO; switch(error) { case ENOENT: + case ESRCH: status = ARES_EOF; break; default: @@ -716,6 +719,7 @@ DhcpNameServer error = ERRNO; switch(error) { case ENOENT: + case ESRCH: status = ARES_EOF; break; default: diff --git a/ares/ares_search.c b/ares/ares_search.c index 4b898a77f..4ff54532e 100644 --- a/ares/ares_search.c +++ b/ares/ares_search.c @@ -273,6 +273,7 @@ static int single_domain(ares_channel channel, const char *name, char **s) switch(error) { case ENOENT: + case ESRCH: break; default: DEBUGF(fprintf(stderr, "fopen() failed with error: %d %s\n", |