From 1043d24e77f82d729996fe8192b078e567b16113 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Tue, 2 Feb 2010 23:09:16 +0100 Subject: remove two checks for gettimeofday error Signed-off-by: Denys Vlasenko --- libc/misc/time/ftime.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'libc/misc') diff --git a/libc/misc/time/ftime.c b/libc/misc/time/ftime.c index b2273860c..ff78d418a 100644 --- a/libc/misc/time/ftime.c +++ b/libc/misc/time/ftime.c @@ -25,8 +25,10 @@ int ftime(struct timeb *timebuf) struct timeval tv; struct timezone tz; - if (gettimeofday (&tv, &tz) < 0) - return -1; + /* In Linux, gettimeofday fails only on bad parameter. + * We know that here parameters aren't bad. + */ + gettimeofday (&tv, &tz); timebuf->time = tv.tv_sec; timebuf->millitm = (tv.tv_usec + 999) / 1000; -- cgit v1.2.3 From 8a227f31655d4cf1e06ceb62d6805a88516d69d4 Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Wed, 3 Feb 2010 20:15:24 +0100 Subject: __uClibc_main: use __pagesize to protect against recursion Signed-off-by: Bernhard Reutner-Fischer --- libc/misc/internals/__uClibc_main.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'libc/misc') 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. */ -- cgit v1.2.3