comparison src/os/unix/ngx_time.c @ 370:54f76b0b8dca

nginx-0.0.7-2004-06-27-22:01:57 import
author Igor Sysoev <igor@sysoev.ru>
date Sun, 27 Jun 2004 18:01:57 +0000
parents ba876b26b76d
children da8c5707af39
comparison
equal deleted inserted replaced
369:9c2515d70489 370:54f76b0b8dca
4 4
5 5
6 void ngx_localtime(ngx_tm_t *tm) 6 void ngx_localtime(ngx_tm_t *tm)
7 { 7 {
8 #if (HAVE_LOCALTIME_R) 8 #if (HAVE_LOCALTIME_R)
9 time_t now;
9 10
10 localtime_r((time_t *) &ngx_cached_time, tm); 11 now = ngx_time();
12 localtime_r(&now, tm);
11 13
12 #else 14 #else
15 time_t now;
13 ngx_tm_t *t; 16 ngx_tm_t *t;
14 17
15 t = localtime((time_t *) &ngx_cached_time); 18 now = ngx_time();
19 t = localtime(&now);
16 *tm = *t; 20 *tm = *t;
17 21
18 #endif 22 #endif
19 23
20 tm->ngx_tm_mon++; 24 tm->ngx_tm_mon++;