From a7afdf1cacc93d2239977dbadd7a16e3653e3a33 Mon Sep 17 00:00:00 2001
From: Bernd Schmidt <bernds_cb1@t-online.de>
Date: Tue, 10 Jun 2008 11:38:53 +0000
Subject: Revert revison 19346, except parts needed by later patches (r19347
 also added __uc_malloc calls in getnetent.c, so we must retain the include
 and libc_hidden_proto).

---
 libc/inet/getnetent.c | 25 ++++++-------------------
 1 file changed, 6 insertions(+), 19 deletions(-)

(limited to 'libc/inet')

diff --git a/libc/inet/getnetent.c b/libc/inet/getnetent.c
index d9122f4e2..6224243d1 100644
--- a/libc/inet/getnetent.c
+++ b/libc/inet/getnetent.c
@@ -36,9 +36,14 @@ libc_hidden_proto(__uc_malloc)
 #include <bits/uClibc_mutex.h>
 __UCLIBC_MUTEX_STATIC(mylock, PTHREAD_MUTEX_INITIALIZER);
 
-static const char NETDB[] = _PATH_NETWORKS;
 
+
+#define	MAXALIASES	35
+static const char NETDB[] = _PATH_NETWORKS;
 static FILE *netf = NULL;
+static char *line = NULL;
+static struct netent net;
+static char *net_aliases[MAXALIASES];
 
 smallint _net_stayopen attribute_hidden;
 
@@ -82,22 +87,6 @@ static char * any(register char *cp, char *match)
     return ((char *)0);
 }
 
-#define	MAXALIASES	35
-static struct {
-	char *line;
-	struct netent net;
-	char *net_aliases[MAXALIASES];
-} *sp;
-#define line        (sp->line)
-#define net         (sp->net)
-#define net_aliases (sp->net_aliases)
-#define INIT_SP() { \
-    if (!sp) { \
-	sp = __uc_malloc(sizeof(*sp)); \
-	line = NULL; \
-    } \
-}
-
 libc_hidden_proto(getnetent)
 struct netent *getnetent(void)
 {
@@ -105,8 +94,6 @@ struct netent *getnetent(void)
     register char *cp, **q;
     struct netent *rv = NULL;
 
-    INIT_SP();
-
     __UCLIBC_MUTEX_LOCK(mylock);
     if (netf == NULL && (netf = fopen(NETDB, "r" )) == NULL) {
 	goto DONE;
-- 
cgit v1.2.3