aboutsummaryrefslogtreecommitdiff
path: root/src/os/win32/ngx_win32_init.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/os/win32/ngx_win32_init.c')
-rw-r--r--src/os/win32/ngx_win32_init.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/os/win32/ngx_win32_init.c b/src/os/win32/ngx_win32_init.c
index 9b26db589..eb3e1386c 100644
--- a/src/os/win32/ngx_win32_init.c
+++ b/src/os/win32/ngx_win32_init.c
@@ -59,12 +59,13 @@ static GUID dx_guid = WSAID_DISCONNECTEX;
ngx_int_t
ngx_os_init(ngx_log_t *log)
{
- DWORD bytes;
- SOCKET s;
- WSADATA wsd;
- ngx_err_t err;
- ngx_uint_t n;
- SYSTEM_INFO si;
+ DWORD bytes;
+ SOCKET s;
+ WSADATA wsd;
+ ngx_err_t err;
+ ngx_time_t *tp;
+ ngx_uint_t n;
+ SYSTEM_INFO si;
/* get Windows version */
@@ -237,7 +238,8 @@ ngx_os_init(ngx_log_t *log)
ngx_sprintf((u_char *) ngx_unique, "%P%Z", ngx_pid);
}
- srand((ngx_pid << 16) ^ (unsigned) ngx_time());
+ tp = ngx_timeofday();
+ srand((ngx_pid << 16) ^ (unsigned) tp->sec ^ tp->msec);
return NGX_OK;
}