From e433ede08ba069f5100737e22eb8627187ae8f92 Mon Sep 17 00:00:00 2001 From: Bernd Schmidt Date: Thu, 12 Jun 2008 10:31:17 +0000 Subject: 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. --- libc/misc/mntent/mntent.c | 6 +++--- libc/misc/regex/regex_old.c | 10 +++------- libc/misc/ttyent/getttyent.c | 6 +++--- 3 files changed, 9 insertions(+), 13 deletions(-) (limited to 'libc/misc') diff --git a/libc/misc/mntent/mntent.c b/libc/misc/mntent/mntent.c index aaf0b68e6..c3367955c 100644 --- a/libc/misc/mntent/mntent.c +++ b/libc/misc/mntent/mntent.c @@ -7,7 +7,6 @@ #include #include #include -#include #include #include @@ -26,7 +25,6 @@ libc_hidden_proto(fseek) libc_hidden_proto(fgets) libc_hidden_proto(abort) libc_hidden_proto(fprintf) -libc_hidden_proto(__uc_malloc) /* Reentrant version of getmntent. */ struct mntent *getmntent_r (FILE *filep, @@ -86,7 +84,9 @@ struct mntent *getmntent(FILE * filep) __UCLIBC_MUTEX_LOCK(mylock); if (!buff) { - buff = __uc_malloc(BUFSIZ); + buff = malloc(BUFSIZ); + if (!buff) + abort(); } tmp = getmntent_r(filep, &mnt, buff, BUFSIZ); diff --git a/libc/misc/regex/regex_old.c b/libc/misc/regex/regex_old.c index b79b41aa3..dc5781967 100644 --- a/libc/misc/regex/regex_old.c +++ b/libc/misc/regex/regex_old.c @@ -36,7 +36,6 @@ #include #include #include -#include #include /* Experimentally off - libc_hidden_proto(memset) */ @@ -49,7 +48,6 @@ libc_hidden_proto(abort) #ifdef __USE_GNU /* Experimentally off - libc_hidden_proto(mempcpy) */ #endif -libc_hidden_proto(__uc_malloc) /* AIX requires this to be the first thing in the file. */ #if defined _AIX && !defined REGEX_MALLOC @@ -309,7 +307,7 @@ extern char *re_syntax_table; # else /* not SYNTAX_TABLE */ -static char *re_syntax_table; /* [CHAR_SET_SIZE] */ +static char re_syntax_table[CHAR_SET_SIZE]; static void init_syntax_once PARAMS ((void)); @@ -317,13 +315,11 @@ static void init_syntax_once () { register int c; - static char done; + static int done = 0; if (done) return; - - re_syntax_table = __uc_malloc(CHAR_SET_SIZE); - bzero (re_syntax_table, CHAR_SET_SIZE); + bzero (re_syntax_table, sizeof re_syntax_table); for (c = 0; c < CHAR_SET_SIZE; ++c) if (ISALNUM (c)) diff --git a/libc/misc/ttyent/getttyent.c b/libc/misc/ttyent/getttyent.c index 7ec228514..b43422ddc 100644 --- a/libc/misc/ttyent/getttyent.c +++ b/libc/misc/ttyent/getttyent.c @@ -34,7 +34,6 @@ #include #include #include -#include #ifdef __UCLIBC_HAS_THREADS__ #include #endif @@ -55,7 +54,6 @@ libc_hidden_proto(__ctype_b_loc) #elif defined __UCLIBC_HAS_CTYPE_TABLES__ libc_hidden_proto(__ctype_b) #endif -libc_hidden_proto(__uc_malloc) static char zapchar; static FILE *tf; @@ -134,7 +132,9 @@ struct ttyent * getttyent(void) return (NULL); if (!line) { - line = __uc_malloc(BUFSIZ); + line = malloc(BUFSIZ); + if (!line) + abort(); } __STDIO_ALWAYS_THREADLOCK(tf); -- cgit v1.2.3