Permalink
Browse files

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

So don't use ERRNO (GetLastError()). Trimmed trailing
blanks.
  • Loading branch information...
1 parent f94afa4 commit 054aa0e11e3e71109bcb994146f2e641916ef115 Gisle Vanem committed Jan 18, 2009
Showing with 7 additions and 7 deletions.
  1. +7 −7 ares_search.c
View
@@ -60,7 +60,7 @@ void ares_search(ares_channel channel, const char *name, int dnsclass,
char *s;
const char *p;
int status, ndots;
-
+
/* If name only yields one domain to search, then we don't have
* 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;
ares_channel channel = squery->channel;
char *s;
-
+
squery->timeouts += timeouts;
/* 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)
squery->status_as_is = status;
- /*
+ /*
* 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,
* then callers like ares_gethostbyname() may want to try a T_A search
@@ -290,18 +290,18 @@ static int single_domain(ares_channel channel, const char *name, char **s)
if (status != ARES_SUCCESS)
return status;
}
- else
+ else
{
- error = ERRNO;
- switch(error)
+ error = errno;
+ switch(error)
{
case ENOENT:
case ESRCH:
break;
default:
DEBUGF(fprintf(stderr, "fopen() failed with error: %d %s\n",
error, strerror(error)));
- DEBUGF(fprintf(stderr, "Error opening file: %s\n",
+ DEBUGF(fprintf(stderr, "Error opening file: %s\n",
hostaliases));
*s = NULL;
return ARES_EFILE;

0 comments on commit 054aa0e

Please sign in to comment.