File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed
Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -1165,14 +1165,19 @@ zend_result validate_timestamp_and_record(zend_persistent_script *persistent_scr
11651165 }
11661166
11671167 if (ZCG (cli_mode )) {
1168+ // check current time as opposed to the "time of request"
1169+ double now = 0.0 ;
1170+ #ifdef HAVE_GETTIMEOFDAY
11681171 struct timeval tp = {0 };
11691172
1170- //check current time as opposed to the "time of request"
1171- if (gettimeofday (& tp , NULL ) != 0 ) {
1172- return SUCCESS ;
1173+ if (UNEXPECTED (gettimeofday (& tp , NULL ) != 0 )) {
1174+ now = (double )time (NULL );
1175+ } else {
1176+ now = (double )(tp .tv_sec + tp .tv_usec / 1000000.00 );
11731177 }
1174-
1175- double now = (double )(tp .tv_sec + tp .tv_usec / 1000000.00 );
1178+ #else
1179+ now = (double )time (NULL );
1180+ #endif
11761181
11771182 if (ZCG (accel_directives ).revalidate_freq && persistent_script -> dynamic_members .revalidate >= now ) {
11781183 return SUCCESS ;
You can’t perform that action at this time.
0 commit comments