diff options
author | Bernd Schmidt <bernds_cb1@t-online.de> | 2008-06-12 10:31:17 +0000 |
---|---|---|
committer | Bernd Schmidt <bernds_cb1@t-online.de> | 2008-06-12 10:31:17 +0000 |
commit | e433ede08ba069f5100737e22eb8627187ae8f92 (patch) | |
tree | 4c4a73520537a733eed495c342951a7c0112cd51 /libc/inet | |
parent | 74d1d18f6bc7140f9bc5568b939870d8ec89b9ad (diff) |
Revert revision 19347, plus libc_hidden_proto for __uc_malloc.
Some of the code is functionally identical before and after, but for now
I'm just mechanically reverting the entire mess.
Diffstat (limited to 'libc/inet')
-rw-r--r-- | libc/inet/getnetent.c | 7 | ||||
-rw-r--r-- | libc/inet/getproto.c | 6 | ||||
-rw-r--r-- | libc/inet/getservice.c | 6 | ||||
-rw-r--r-- | libc/inet/rpc/ruserpass.c | 7 |
4 files changed, 10 insertions, 16 deletions
diff --git a/libc/inet/getnetent.c b/libc/inet/getnetent.c index 6224243d1..863266d48 100644 --- a/libc/inet/getnetent.c +++ b/libc/inet/getnetent.c @@ -19,7 +19,6 @@ #include <features.h> #include <stdio.h> #include <stdlib.h> -#include <malloc.h> #include <netdb.h> #include <arpa/inet.h> #include <unistd.h> @@ -30,8 +29,6 @@ libc_hidden_proto(inet_network) libc_hidden_proto(rewind) libc_hidden_proto(fgets) libc_hidden_proto(abort) -libc_hidden_proto(__uc_malloc) - #include <bits/uClibc_mutex.h> __UCLIBC_MUTEX_STATIC(mylock, PTHREAD_MUTEX_INITIALIZER); @@ -101,7 +98,9 @@ struct netent *getnetent(void) again: if (!line) { - line = __uc_malloc(BUFSIZ + 1); + line = malloc(BUFSIZ + 1); + if (!line) + abort(); } p = fgets(line, BUFSIZ, netf); diff --git a/libc/inet/getproto.c b/libc/inet/getproto.c index 7f3b4e30f..1e3e843f5 100644 --- a/libc/inet/getproto.c +++ b/libc/inet/getproto.c @@ -59,7 +59,6 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> -#include <malloc.h> #include <errno.h> #include <unistd.h> @@ -71,7 +70,6 @@ libc_hidden_proto(rewind) libc_hidden_proto(fgets) libc_hidden_proto(fclose) libc_hidden_proto(abort) -libc_hidden_proto(__uc_malloc) #include <bits/uClibc_mutex.h> __UCLIBC_MUTEX_STATIC(mylock, PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP); @@ -89,7 +87,9 @@ static smallint proto_stayopen; static void __initbuf(void) { if (!static_aliases) { - static_aliases = __uc_malloc(SBUFSIZE); + static_aliases = malloc(SBUFSIZE); + if (!static_aliases) + abort(); } } diff --git a/libc/inet/getservice.c b/libc/inet/getservice.c index c8ee77559..bb1d6d2e4 100644 --- a/libc/inet/getservice.c +++ b/libc/inet/getservice.c @@ -59,7 +59,6 @@ #include <stdio.h> #include <string.h> #include <stdlib.h> -#include <malloc.h> #include <netinet/in.h> #include <arpa/inet.h> #include <errno.h> @@ -73,7 +72,6 @@ libc_hidden_proto(atoi) libc_hidden_proto(rewind) libc_hidden_proto(fgets) libc_hidden_proto(abort) -libc_hidden_proto(__uc_malloc) #include <bits/uClibc_mutex.h> __UCLIBC_MUTEX_STATIC(mylock, PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP); @@ -92,7 +90,9 @@ static smallint serv_stayopen; static void __initbuf(void) { if (!servbuf) { - servbuf = __uc_malloc(SBUFSIZE); + servbuf = malloc(SBUFSIZE); + if (!servbuf) + abort(); } } diff --git a/libc/inet/rpc/ruserpass.c b/libc/inet/rpc/ruserpass.c index 75d68dd91..ad6e703c4 100644 --- a/libc/inet/rpc/ruserpass.c +++ b/libc/inet/rpc/ruserpass.c @@ -40,7 +40,6 @@ #include <stdio_ext.h> #include <stdlib.h> #include <string.h> -#include <malloc.h> #include <unistd.h> /* Experimentally off - libc_hidden_proto(strcat) */ @@ -64,7 +63,6 @@ libc_hidden_proto(fopen) libc_hidden_proto(fclose) libc_hidden_proto(getc_unlocked) libc_hidden_proto(__fgetc_unlocked) -libc_hidden_proto(__uc_malloc) #define _(X) (X) /* #include "ftp_var.h" */ @@ -80,7 +78,7 @@ static FILE *cfile; #define ID 10 #define MACHINE 11 -static char *tokval; /* [100] */ +static char tokval[100]; static const char tokstr[] = { @@ -153,9 +151,6 @@ int ruserpass(const char *host, const char **aname, const char **apass) if (mydomain==NULL) { mydomain=myname + strlen(myname); } - - if (!tokval) - tokval = __uc_malloc(100); next: while ((t = token())) switch(t) { |