diff src/os/unix/ngx_process_cycle.c @ 6650:1a1d55834b5c

Fixed undefined behavior when left shifting signed integer.
author Ruslan Ermilov <ru@nginx.com>
date Thu, 04 Aug 2016 23:42:00 +0300
parents f01ab2dbcfdc
children 7d4e33092e2a
line wrap: on
line diff
--- a/src/os/unix/ngx_process_cycle.c	Thu Aug 04 01:15:41 2016 +0300
+++ b/src/os/unix/ngx_process_cycle.c	Thu Aug 04 23:42:00 2016 +0300
@@ -884,7 +884,7 @@
                       "sigprocmask() failed");
     }
 
-    srandom((ngx_pid << 16) ^ ngx_time());
+    srandom(((unsigned) ngx_pid << 16) ^ ngx_time());
 
     /*
      * disable deleting previous events for the listening sockets because