summaryrefslogtreecommitdiff
path: root/libc/inet
diff options
context:
space:
mode:
authorBernd Schmidt <bernds_cb1@t-online.de>2008-06-10 11:38:53 +0000
committerBernd Schmidt <bernds_cb1@t-online.de>2008-06-10 11:38:53 +0000
commita7afdf1cacc93d2239977dbadd7a16e3653e3a33 (patch)
treea8755e3e6afb96035fc70d639d91e20726042eb5 /libc/inet
parent212bd82fe640619297cb51bd2bb109aa7b500ee1 (diff)
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).
Diffstat (limited to 'libc/inet')
-rw-r--r--libc/inet/getnetent.c25
1 files changed, 6 insertions, 19 deletions
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;