nginx-0.0.1-2003-11-11-00:09:22 import
diff --git a/src/os/unix/ngx_time.c b/src/os/unix/ngx_time.c
index 12256e1..bf3432b 100644
--- a/src/os/unix/ngx_time.c
+++ b/src/os/unix/ngx_time.c
@@ -1,11 +1,12 @@
#include <ngx_config.h>
-#include <ngx_time.h>
+#include <ngx_core.h>
+
void ngx_localtime(ngx_tm_t *tm)
{
- time_t clock = time(NULL);
- localtime_r(&clock, tm);
+ localtime_r(&ngx_cached_time, tm);
+
tm->ngx_tm_mon++;
tm->ngx_tm_year += 1900;
}
diff --git a/src/os/unix/ngx_time.h b/src/os/unix/ngx_time.h
index ee5b47f..cdec417 100644
--- a/src/os/unix/ngx_time.h
+++ b/src/os/unix/ngx_time.h
@@ -23,8 +23,10 @@
ngx_msec_t ngx_msec(void);
-/* STUB */
-#define ngx_time() time(NULL)
+time_t ngx_time();
+
+extern time_t ngx_cached_time;
+
#endif /* _NGX_TIME_H_INCLUDED_ */