aboutsummaryrefslogtreecommitdiff
path: root/src/os/unix/ngx_time.c
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2003-11-11 18:13:43 +0000
committerIgor Sysoev <igor@sysoev.ru>2003-11-11 18:13:43 +0000
commit27c30f9919ed695ab718c3365a445d47a14fd80f (patch)
treeb8bd50e2fcecf477f1bb05d61fc7626c06a4442b /src/os/unix/ngx_time.c
parentd59a047a7070dc6af13b2e35c097efccc8ce38d0 (diff)
downloadnginx-27c30f9919ed695ab718c3365a445d47a14fd80f.tar.gz
nginx-27c30f9919ed695ab718c3365a445d47a14fd80f.zip
nginx-0.0.1-2003-11-11-21:13:43 import
Diffstat (limited to 'src/os/unix/ngx_time.c')
-rw-r--r--src/os/unix/ngx_time.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/os/unix/ngx_time.c b/src/os/unix/ngx_time.c
index bf3432ba7..37039918e 100644
--- a/src/os/unix/ngx_time.c
+++ b/src/os/unix/ngx_time.c
@@ -5,22 +5,24 @@
void ngx_localtime(ngx_tm_t *tm)
{
+#if (HAVE_LOCALTIME_R)
+
localtime_r(&ngx_cached_time, tm);
- tm->ngx_tm_mon++;
- tm->ngx_tm_year += 1900;
-}
+#else
+ ngx_tm_t *t;
-u_int ngx_msec(void)
-{
- struct timeval tv;
+ t = localtime(&ngx_cached_time);
+ *tm = *t;
- gettimeofday(&tv, NULL);
+#endif
- return tv.tv_sec * 1000 + tv.tv_usec / 1000;
+ tm->ngx_tm_mon++;
+ tm->ngx_tm_year += 1900;
}
+
#if 0
typedef struct {