diff options
author | Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | 2010-02-03 20:15:24 +0100 |
---|---|---|
committer | Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | 2010-02-03 20:15:24 +0100 |
commit | 8a227f31655d4cf1e06ceb62d6805a88516d69d4 (patch) | |
tree | bdaef9a2e2c730faef5a8742cc79a0e52323bb71 /libc/misc | |
parent | f588c2d4bb2d9cb5f2ae5f4f50a7eaf60f80aff6 (diff) |
__uClibc_main: use __pagesize to protect against recursion
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Diffstat (limited to 'libc/misc')
-rw-r--r-- | libc/misc/internals/__uClibc_main.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/libc/misc/internals/__uClibc_main.c b/libc/misc/internals/__uClibc_main.c index 19acbe0d6..6e520fabb 100644 --- a/libc/misc/internals/__uClibc_main.c +++ b/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. */ |