Browse Source

__uClibc_main: use __pagesize to protect against recursion

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Bernhard Reutner-Fischer 15 years ago
parent
commit
8a227f3165
1 changed files with 2 additions and 4 deletions
  1. 2 4
      libc/misc/internals/__uClibc_main.c

+ 2 - 4
libc/misc/internals/__uClibc_main.c

@@ -168,11 +168,9 @@ extern void __uClibc_init(void);
 libc_hidden_proto(__uClibc_init)
 void __uClibc_init(void)
 {
-    static smallint been_there_done_that;
-
-    if (been_there_done_that)
+    /* Don't recurse */
+    if (__pagesize)
 	return;
-    been_there_done_that++;
 
     /* Setup an initial value.  This may not be perfect, but is
      * better than  malloc using __pagesize=0 for atexit, ctors, etc.  */