summaryrefslogtreecommitdiff
path: root/libc/misc
diff options
context:
space:
mode:
authorAustin Foxley <austinf@cetoncorp.com>2010-02-05 11:10:14 -0800
committerAustin Foxley <austinf@cetoncorp.com>2010-02-05 11:10:32 -0800
commitf7eba78a7464c7b31326abf92dab254608835028 (patch)
tree5558a9e8d2c7c4484387030427701d81bd8b83e5 /libc/misc
parent3e808a4c28f214314e8457672fae0f5d17f5450a (diff)
parentdf1580676a48dc3a9faf7e508ad3ec822a8e5a05 (diff)
Merge commit 'origin/master' into nptl
Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
Diffstat (limited to 'libc/misc')
-rw-r--r--libc/misc/internals/__uClibc_main.c6
-rw-r--r--libc/misc/time/ftime.c6
2 files changed, 6 insertions, 6 deletions
diff --git a/libc/misc/internals/__uClibc_main.c b/libc/misc/internals/__uClibc_main.c
index c5feedeba..f7e45c60c 100644
--- a/libc/misc/internals/__uClibc_main.c
+++ b/libc/misc/internals/__uClibc_main.c
@@ -179,11 +179,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. */
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;