Quick and dirty fix of the DNS resolver bug. Now "ping localhost" works again! :))

The problem was that netdb.h defined a macro that always replaced h_errno with a function call so that libnet.so failed when res_query (and all other functions using h_errno, but this is where the bug occured for me) tried to assign a new value to h_errno which of course failed because it was actually assigned to the return value of _h_errnop().


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5010 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Waldemar Kornewald 2003-10-13 14:42:18 +00:00
parent b032f97253
commit e3cdd30a7a
7 changed files with 19 additions and 1 deletions

View File

@ -13,6 +13,8 @@
#include <TLS.h> #include <TLS.h>
#undef h_errno
// was defined by netdb.h
static int32 h_errno_tls; static int32 h_errno_tls;
/* These should probably be moved to a seperate file as they /* These should probably be moved to a seperate file as they

View File

@ -96,6 +96,9 @@
*/ */
#include <stdarg.h> #include <stdarg.h>
#undef h_errno
// was defined by netdb.h
#ifdef YP #ifdef YP
#include <rpc/rpc.h> #include <rpc/rpc.h>
#include <rpcsvc/yp.h> #include <rpcsvc/yp.h>

View File

@ -52,6 +52,9 @@
#include <string.h> #include <string.h>
#include <stddef.h> #include <stddef.h>
#undef h_errno
// was defined by netdb.h
static const struct afd { static const struct afd {
int a_af; int a_af;
int a_addrlen; int a_addrlen;

View File

@ -83,6 +83,8 @@
#include <errno.h> #include <errno.h>
#include <string.h> #include <string.h>
#undef h_errno
// was defined by netdb.h
extern int h_errno; extern int h_errno;
struct netent *_getnetbyaddr (in_addr_t net, int type); struct netent *_getnetbyaddr (in_addr_t net, int type);

View File

@ -91,6 +91,9 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#undef h_errno
// was defined by netdb.h
extern const char *_res_opcodes[]; extern const char *_res_opcodes[];
extern const char *_res_resultcodes[]; extern const char *_res_resultcodes[];

View File

@ -64,6 +64,9 @@
#include <resolv.h> #include <resolv.h>
#include <string.h> #include <string.h>
#undef h_errno
// was defined by netdb.h
/* /*
* Form all types of queries. * Form all types of queries.
* Returns the size of the result or -1. * Returns the size of the result or -1.

View File

@ -75,7 +75,9 @@
#endif #endif
const char *hostalias (const char *); const char *hostalias (const char *);
int h_errno; #undef h_errno
// was defined by netdb.h
int h_errno = 0;
extern int res_opt (int, u_char *, int, int); extern int res_opt (int, u_char *, int, int);
/* /*