summaryrefslogtreecommitdiff
path: root/ares_gethostbyname.c
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2011-03-23 20:53:28 +0100
committerYang Tse <yangsita@gmail.com>2011-03-23 20:53:28 +0100
commitbd066ab8efa0d43ef002954f4587a195a15ac460 (patch)
tree450f425d38f2c2d873e5cd8f1f829a957d1d4a4e /ares_gethostbyname.c
parent822fd0f8771d3792da0a08276ab0400b2a68f07e (diff)
downloadc-ares-bd066ab8efa0d43ef002954f4587a195a15ac460.tar.gz
c-ares-bd066ab8efa0d43ef002954f4587a195a15ac460.tar.bz2
c-ares-bd066ab8efa0d43ef002954f4587a195a15ac460.zip
build: find out windows platform using GetVersionEx()
Diffstat (limited to 'ares_gethostbyname.c')
-rw-r--r--ares_gethostbyname.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/ares_gethostbyname.c b/ares_gethostbyname.c
index 4469ffe..6599c08 100644
--- a/ares_gethostbyname.c
+++ b/ares_gethostbyname.c
@@ -344,7 +344,13 @@ static int file_lookup(const char *name, int family, struct hostent **host)
#ifdef WIN32
char PATH_HOSTS[MAX_PATH];
- if (IS_NT()) {
+ win_platform platform;
+
+ PATH_HOSTS[0] = '\0';
+
+ platform = getplatform();
+
+ if (platform == WIN_NT) {
char tmp[MAX_PATH];
HKEY hkeyHosts;
@@ -358,8 +364,10 @@ static int file_lookup(const char *name, int family, struct hostent **host)
RegCloseKey(hkeyHosts);
}
}
- else
+ else if (platform == WIN_9X)
GetWindowsDirectory(PATH_HOSTS, MAX_PATH);
+ else
+ return ARES_ENOTFOUND;
strcat(PATH_HOSTS, WIN_PATH_HOSTS);