summaryrefslogtreecommitdiff
path: root/libc
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2002-08-19 11:07:21 +0000
committerEric Andersen <andersen@codepoet.org>2002-08-19 11:07:21 +0000
commitbfefdc65657e145a0e05886ec571e0ee6af1a290 (patch)
treee072cf8ca55d809102a59836e70bf00782c4b706 /libc
parent9a87c828751eddd3f3fef0b74f3f9c2271eacf6c (diff)
Fixup struct _res handling so apps using struct _res can actually
compile ("worst standard ever!") -Erik
Diffstat (limited to 'libc')
-rw-r--r--libc/inet/resolv.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/libc/inet/resolv.c b/libc/inet/resolv.c
index 7dc5bc51e..62b091770 100644
--- a/libc/inet/resolv.c
+++ b/libc/inet/resolv.c
@@ -967,16 +967,11 @@ struct netent * getnetbyname(const char * name)
#ifdef L_res_init
-struct __res_state * __res;
+struct __res_state _res;
int res_init(void)
{
- struct __res_state *rp = __res;
- if(!__res) {
- rp = (struct __res_state *) malloc(sizeof(struct __res_state));
- memset(rp, 0, sizeof(struct __res_state));
- __res = rp;
- }
+ struct __res_state *rp = &(_res);
__open_nameservers();
rp->retrans = RES_TIMEOUT;
@@ -1021,10 +1016,6 @@ int res_init(void)
void res_close( void )
{
- if(__res) {
- free(__res);
- __res = NULL;
- }
return;
}