fopen() returns error in 'errno' even on Windows.

So don't use ERRNO (GetLastError()). Trimmed trailing
blanks.
pull/1/head curl-7_19_3
Gisle Vanem 16 years ago
parent f94afa4fdc
commit 054aa0e11e
  1. 14
      ares_search.c

@ -60,7 +60,7 @@ void ares_search(ares_channel channel, const char *name, int dnsclass,
char *s; char *s;
const char *p; const char *p;
int status, ndots; int status, ndots;
/* If name only yields one domain to search, then we don't have /* If name only yields one domain to search, then we don't have
* to keep extra state, so just do an ares_query(). * to keep extra state, so just do an ares_query().
*/ */
@ -148,7 +148,7 @@ static void search_callback(void *arg, int status, int timeouts,
struct search_query *squery = (struct search_query *) arg; struct search_query *squery = (struct search_query *) arg;
ares_channel channel = squery->channel; ares_channel channel = squery->channel;
char *s; char *s;
squery->timeouts += timeouts; squery->timeouts += timeouts;
/* Stop searching unless we got a non-fatal error. */ /* Stop searching unless we got a non-fatal error. */
@ -161,7 +161,7 @@ static void search_callback(void *arg, int status, int timeouts,
if (squery->trying_as_is) if (squery->trying_as_is)
squery->status_as_is = status; squery->status_as_is = status;
/* /*
* If we ever get ARES_ENODATA along the way, record that; if the search * If we ever get ARES_ENODATA along the way, record that; if the search
* should run to the very end and we got at least one ARES_ENODATA, * should run to the very end and we got at least one ARES_ENODATA,
* then callers like ares_gethostbyname() may want to try a T_A search * then callers like ares_gethostbyname() may want to try a T_A search
@ -290,10 +290,10 @@ static int single_domain(ares_channel channel, const char *name, char **s)
if (status != ARES_SUCCESS) if (status != ARES_SUCCESS)
return status; return status;
} }
else else
{ {
error = ERRNO; error = errno;
switch(error) switch(error)
{ {
case ENOENT: case ENOENT:
case ESRCH: case ESRCH:
@ -301,7 +301,7 @@ static int single_domain(ares_channel channel, const char *name, char **s)
default: default:
DEBUGF(fprintf(stderr, "fopen() failed with error: %d %s\n", DEBUGF(fprintf(stderr, "fopen() failed with error: %d %s\n",
error, strerror(error))); error, strerror(error)));
DEBUGF(fprintf(stderr, "Error opening file: %s\n", DEBUGF(fprintf(stderr, "Error opening file: %s\n",
hostaliases)); hostaliases));
*s = NULL; *s = NULL;
return ARES_EFILE; return ARES_EFILE;

Loading…
Cancel
Save