svn commit: trunk/uClibc/libc: inet inet/rpc misc/mntent misc/regex mis etc...

bernds at uclibc.org bernds at uclibc.org
Thu Jun 12 10:31:20 UTC 2008


Author: bernds
Date: 2008-06-12 03:31:17 -0700 (Thu, 12 Jun 2008)
New Revision: 22302

Log:
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.


Modified:
   trunk/uClibc/libc/inet/getnetent.c
   trunk/uClibc/libc/inet/getproto.c
   trunk/uClibc/libc/inet/getservice.c
   trunk/uClibc/libc/inet/rpc/ruserpass.c
   trunk/uClibc/libc/misc/mntent/mntent.c
   trunk/uClibc/libc/misc/regex/regex_old.c
   trunk/uClibc/libc/misc/ttyent/getttyent.c


Changeset:
Modified: trunk/uClibc/libc/inet/getnetent.c
===================================================================
--- trunk/uClibc/libc/inet/getnetent.c	2008-06-12 10:14:14 UTC (rev 22301)
+++ trunk/uClibc/libc/inet/getnetent.c	2008-06-12 10:31:17 UTC (rev 22302)
@@ -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,9 +29,7 @@
 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 @@
 again:
 
     if (!line) {
-	line = __uc_malloc(BUFSIZ + 1);
+	line = malloc(BUFSIZ + 1);
+	if (!line)
+	    abort();
     }
 
     p = fgets(line, BUFSIZ, netf);

Modified: trunk/uClibc/libc/inet/getproto.c
===================================================================
--- trunk/uClibc/libc/inet/getproto.c	2008-06-12 10:14:14 UTC (rev 22301)
+++ trunk/uClibc/libc/inet/getproto.c	2008-06-12 10:31:17 UTC (rev 22302)
@@ -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(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 void __initbuf(void)
 {
     if (!static_aliases) {
-	static_aliases = __uc_malloc(SBUFSIZE);
+	static_aliases = malloc(SBUFSIZE);
+	if (!static_aliases)
+	    abort();
     }
 }
 

Modified: trunk/uClibc/libc/inet/getservice.c
===================================================================
--- trunk/uClibc/libc/inet/getservice.c	2008-06-12 10:14:14 UTC (rev 22301)
+++ trunk/uClibc/libc/inet/getservice.c	2008-06-12 10:31:17 UTC (rev 22302)
@@ -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(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 void __initbuf(void)
 {
     if (!servbuf) {
-	servbuf = __uc_malloc(SBUFSIZE);
+	servbuf = malloc(SBUFSIZE);
+	if (!servbuf)
+	    abort();
     }
 }
 

Modified: trunk/uClibc/libc/inet/rpc/ruserpass.c
===================================================================
--- trunk/uClibc/libc/inet/rpc/ruserpass.c	2008-06-12 10:14:14 UTC (rev 22301)
+++ trunk/uClibc/libc/inet/rpc/ruserpass.c	2008-06-12 10:31:17 UTC (rev 22302)
@@ -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(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 @@
 #define	ID	10
 #define	MACHINE	11
 
-static char *tokval; /* [100] */
+static char tokval[100];
 
 static const char tokstr[] =
 {
@@ -153,9 +151,6 @@
 	if (mydomain==NULL) {
 	    mydomain=myname + strlen(myname);
 	}
-
-	if (!tokval)
-		tokval = __uc_malloc(100);
 next:
 	while ((t = token())) switch(t) {
 

Modified: trunk/uClibc/libc/misc/mntent/mntent.c
===================================================================
--- trunk/uClibc/libc/misc/mntent/mntent.c	2008-06-12 10:14:14 UTC (rev 22301)
+++ trunk/uClibc/libc/misc/mntent/mntent.c	2008-06-12 10:31:17 UTC (rev 22302)
@@ -7,7 +7,6 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <malloc.h>
 #include <mntent.h>
 #include <bits/uClibc_mutex.h>
 
@@ -26,7 +25,6 @@
 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 @@
     __UCLIBC_MUTEX_LOCK(mylock);
     
     if (!buff) {
-            buff = __uc_malloc(BUFSIZ);
+            buff = malloc(BUFSIZ);
+		if (!buff)
+		    abort();
     }
     
     tmp = getmntent_r(filep, &mnt, buff, BUFSIZ);

Modified: trunk/uClibc/libc/misc/regex/regex_old.c
===================================================================
--- trunk/uClibc/libc/misc/regex/regex_old.c	2008-06-12 10:14:14 UTC (rev 22301)
+++ trunk/uClibc/libc/misc/regex/regex_old.c	2008-06-12 10:31:17 UTC (rev 22302)
@@ -36,7 +36,6 @@
 #include <stdint.h>
 #include <string.h>
 #include <unistd.h>
-#include <malloc.h>
 #include <stdio.h>
 
 /* Experimentally off - libc_hidden_proto(memset) */
@@ -49,7 +48,6 @@
 #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 @@
 
 #  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,14 +315,12 @@
 init_syntax_once ()
 {
    register int c;
-   static char done;
+   static int done = 0;
 
    if (done)
      return;
+   bzero (re_syntax_table, sizeof re_syntax_table);
 
-   re_syntax_table = __uc_malloc(CHAR_SET_SIZE);
-   bzero (re_syntax_table, CHAR_SET_SIZE);
-
    for (c = 0; c < CHAR_SET_SIZE; ++c)
      if (ISALNUM (c))
 	re_syntax_table[c] = Sword;

Modified: trunk/uClibc/libc/misc/ttyent/getttyent.c
===================================================================
--- trunk/uClibc/libc/misc/ttyent/getttyent.c	2008-06-12 10:14:14 UTC (rev 22301)
+++ trunk/uClibc/libc/misc/ttyent/getttyent.c	2008-06-12 10:31:17 UTC (rev 22302)
@@ -34,7 +34,6 @@
 #include <ctype.h>
 #include <string.h>
 #include <stdlib.h>
-#include <malloc.h>
 #ifdef __UCLIBC_HAS_THREADS__
 #include <pthread.h>
 #endif
@@ -55,7 +54,6 @@
 #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 @@
 	return (NULL);
 
     if (!line) {
-            line = __uc_malloc(BUFSIZ);
+            line = malloc(BUFSIZ);
+		if (!line)
+		    abort();
     }
 
 	__STDIO_ALWAYS_THREADLOCK(tf);




More information about the uClibc-cvs mailing list