diff options
author | Nicolas Planel <nplanel@mandriva.com> | 2003-10-29 16:07:11 +0000 |
---|---|---|
committer | Nicolas Planel <nplanel@mandriva.com> | 2003-10-29 16:07:11 +0000 |
commit | de47eb59bb829423b1d0f47ba13099073999b3cb (patch) | |
tree | 827f35c4666e15ec66edae7c1fa05d963324602b /mdk-stage1/dns.c | |
parent | 1fece42e9c460ca017fc4facad380f05163d8977 (diff) | |
download | drakx-backup-do-not-use-topic/Corpo_2_1.tar drakx-backup-do-not-use-topic/Corpo_2_1.tar.gz drakx-backup-do-not-use-topic/Corpo_2_1.tar.bz2 drakx-backup-do-not-use-topic/Corpo_2_1.tar.xz drakx-backup-do-not-use-topic/Corpo_2_1.zip |
Corporate Server 2.1.1 releasetopic/Corpo_2_1
Diffstat (limited to 'mdk-stage1/dns.c')
-rw-r--r-- | mdk-stage1/dns.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/mdk-stage1/dns.c b/mdk-stage1/dns.c index d1e67c78d..5ba55486a 100644 --- a/mdk-stage1/dns.c +++ b/mdk-stage1/dns.c @@ -23,7 +23,7 @@ // dietlibc can do hostname lookup, whereas glibc can't when linked statically :-( -#ifdef __LIBC_DIETLIBC__ +#if defined(__dietlibc__) #include <unistd.h> #include <string.h> @@ -67,15 +67,14 @@ char * mygethostbyaddr(char * ipnum) struct hostent * host; if (!inet_aton(ipnum, &in)) return NULL; - host = gethostbyaddr(&in, strlen((void *) &in), AF_INET); + host = gethostbyaddr(&(in.s_addr), sizeof(in.s_addr) /* INADDRSZ */, AF_INET); if (host && host->h_name) return host->h_name; return NULL; } - -#else // __LIBC_DIETLIBC__ - +#elif defined(__GLIBC__) + #include <alloca.h> #include <sys/socket.h> #include <netinet/in.h> @@ -210,4 +209,8 @@ int mygethostbyname(char * name, struct in_addr * addr) { return rc; } +#else + +#error "Unsupported C library" + #endif |