OSDN Git Service

__uClibc_main: use __pagesize to protect against recursion
authorBernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Wed, 3 Feb 2010 19:15:24 +0000 (20:15 +0100)
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Wed, 3 Feb 2010 19:15:24 +0000 (20:15 +0100)
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
libc/misc/internals/__uClibc_main.c

index 19acbe0..6e520fa 100644 (file)
@@ -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.  */