diff src/os/unix/ngx_process_cycle.c @ 5499:b91bcba29351

Added per-process random seeding (ticket #456).
author Maxim Dounin <mdounin@mdounin.ru>
date Sat, 04 Jan 2014 03:32:06 +0400
parents 8e7db77e5d88
children e45fa57ef725
line wrap: on
line diff
--- a/src/os/unix/ngx_process_cycle.c
+++ b/src/os/unix/ngx_process_cycle.c
@@ -959,6 +959,8 @@ ngx_worker_process_init(ngx_cycle_t *cyc
                       "sigprocmask() failed");
     }
 
+    srandom((ngx_pid << 16) ^ ngx_time());
+
     /*
      * disable deleting previous events for the listening sockets because
      * in the worker processes there are no events at all at this point