comparison 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
comparison
equal deleted inserted replaced
6649:09c918460cc6 6650:1a1d55834b5c
882 if (sigprocmask(SIG_SETMASK, &set, NULL) == -1) { 882 if (sigprocmask(SIG_SETMASK, &set, NULL) == -1) {
883 ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno, 883 ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno,
884 "sigprocmask() failed"); 884 "sigprocmask() failed");
885 } 885 }
886 886
887 srandom((ngx_pid << 16) ^ ngx_time()); 887 srandom(((unsigned) ngx_pid << 16) ^ ngx_time());
888 888
889 /* 889 /*
890 * disable deleting previous events for the listening sockets because 890 * disable deleting previous events for the listening sockets because
891 * in the worker processes there are no events at all at this point 891 * in the worker processes there are no events at all at this point
892 */ 892 */