]> git.saurik.com Git - apple/libc.git/blob - gen/FreeBSD/time.c.patch
Libc-498.1.5.tar.gz
[apple/libc.git] / gen / FreeBSD / time.c.patch
1 --- time.c.orig 2008-07-30 13:29:30.000000000 -0700
2 +++ time.c 2008-07-30 13:36:03.000000000 -0700
3 @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD: src/lib/libc/gen/tim
4
5 #include <sys/types.h>
6 #include <sys/time.h>
7 +#include <fenv.h>
8
9 time_t
10 time(t)
11 @@ -46,12 +47,21 @@ time(t)
12 {
13 struct timeval tt;
14 time_t retval;
15 +#ifdef FE_DFL_ENV
16 + fenv_t fenv;
17 +#endif /* FE_DFL_ENV */
18
19 +#ifdef FE_DFL_ENV
20 + fegetenv(&fenv); /* 3965505 - need to preserve floating point enviroment */
21 +#endif /* FE_DFL_ENV */
22 if (gettimeofday(&tt, (struct timezone *)0) < 0)
23 retval = -1;
24 else
25 retval = tt.tv_sec;
26 if (t != NULL)
27 *t = retval;
28 +#ifdef FE_DFL_ENV
29 + fesetenv(&fenv);
30 +#endif /* FE_DFL_ENV */
31 return (retval);
32 }