mirror of
https://github.com/nginx/nginx.git
synced 2024-12-03 04:39:00 +08:00
Fixed possible use of old cached times if runtime went backwards.
If ngx_time_sigsafe_update() updated only ngx_cached_err_log_time, and then clock was adjusted backwards, the cached_time[slot].sec might accidentally match current seconds on next ngx_time_update() call, resulting in various cached times not being updated. Fix is to clear the cached_time[slot].sec to explicitly mark cached times are stale and need updating.
This commit is contained in:
parent
d053bacb9c
commit
25197b3229
@ -211,6 +211,10 @@ ngx_time_sigsafe_update(void)
|
||||
slot++;
|
||||
}
|
||||
|
||||
tp = &cached_time[slot];
|
||||
|
||||
tp->sec = 0;
|
||||
|
||||
ngx_gmtime(sec + cached_gmtoff * 60, &tm);
|
||||
|
||||
p = &cached_err_log_time[slot][0];
|
||||
|
Loading…
Reference in New Issue
Block a user