|
|
@ -466,16 +466,21 @@ static int file_lookup(struct host_query *hquery) |
|
|
|
{ |
|
|
|
{ |
|
|
|
case ENOENT: |
|
|
|
case ENOENT: |
|
|
|
case ESRCH: |
|
|
|
case ESRCH: |
|
|
|
return ARES_ENOTFOUND; |
|
|
|
status = ARES_ENOTFOUND; |
|
|
|
|
|
|
|
break; |
|
|
|
default: |
|
|
|
default: |
|
|
|
DEBUGF(fprintf(stderr, "fopen() failed with error: %d %s\n", error, |
|
|
|
DEBUGF(fprintf(stderr, "fopen() failed with error: %d %s\n", error, |
|
|
|
strerror(error))); |
|
|
|
strerror(error))); |
|
|
|
DEBUGF(fprintf(stderr, "Error opening file: %s\n", path_hosts)); |
|
|
|
DEBUGF(fprintf(stderr, "Error opening file: %s\n", path_hosts)); |
|
|
|
return ARES_EFILE; |
|
|
|
status = ARES_EFILE; |
|
|
|
|
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
status = ares__readaddrinfo(fp, hquery->name, hquery->port, &hquery->hints, hquery->ai); |
|
|
|
else |
|
|
|
fclose(fp); |
|
|
|
{ |
|
|
|
|
|
|
|
status = ares__readaddrinfo(fp, hquery->name, hquery->port, &hquery->hints, hquery->ai); |
|
|
|
|
|
|
|
fclose(fp); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/* RFC6761 section 6.3 #3 states that "Name resolution APIs and libraries
|
|
|
|
/* RFC6761 section 6.3 #3 states that "Name resolution APIs and libraries
|
|
|
|
* SHOULD recognize localhost names as special and SHOULD always return the |
|
|
|
* SHOULD recognize localhost names as special and SHOULD always return the |
|
|
|