Mercurial > hg > nginx
diff src/os/unix/ngx_process_cycle.c @ 6651:7d4e33092e2a
Always seed PRNG with PID, seconds, and milliseconds.
author | Ruslan Ermilov <ru@nginx.com> |
---|---|
date | Thu, 04 Aug 2016 23:43:10 +0300 |
parents | 1a1d55834b5c |
children | ca709bca4b77 |
line wrap: on
line diff
--- a/src/os/unix/ngx_process_cycle.c Thu Aug 04 23:42:00 2016 +0300 +++ b/src/os/unix/ngx_process_cycle.c Thu Aug 04 23:43:10 2016 +0300 @@ -785,6 +785,7 @@ { sigset_t set; ngx_int_t n; + ngx_time_t *tp; ngx_uint_t i; ngx_cpuset_t *cpu_affinity; struct rlimit rlmt; @@ -884,7 +885,8 @@ "sigprocmask() failed"); } - srandom(((unsigned) ngx_pid << 16) ^ ngx_time()); + tp = ngx_timeofday(); + srandom(((unsigned) ngx_pid << 16) ^ tp->sec ^ tp->msec); /* * disable deleting previous events for the listening sockets because