]> git.saurik.com Git - apple/libc.git/blame - gen/FreeBSD/time.c.patch
Libc-498.1.1.tar.gz
[apple/libc.git] / gen / FreeBSD / time.c.patch
CommitLineData
224c7076
A
1--- time.c.orig 2004-11-25 11:38:01.000000000 -0800
2+++ time.c 2005-03-24 14:09:30.000000000 -0800
3@@ -39,6 +39,7 @@
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,15 @@
12 {
13 struct timeval tt;
14 time_t retval;
15+ fenv_t fenv;
16
17+ fegetenv(&fenv); /* 3965505 - need to preserve floating point enviroment */
18 if (gettimeofday(&tt, (struct timezone *)0) < 0)
19 retval = -1;
20 else
21 retval = tt.tv_sec;
22 if (t != NULL)
23 *t = retval;
24+ fesetenv(&fenv);
25 return (retval);
26 }