forked from enlightenment/efl
ecore: replace arbitrary time with 32-bit safe arbitrary time
The end of time is much closer than you think. it_value.tv_sec is a signed 32-bit number on 32-bit machines. Using a negative tv_sec causes timerfd_settime() to fail.
This commit is contained in:
parent
62ca4486ea
commit
7785bfa167
|
@ -952,7 +952,7 @@ detect_time_changes_start(void)
|
||||||
if (realtime_fd < 0) return;
|
if (realtime_fd < 0) return;
|
||||||
|
|
||||||
memset(&its, 0, sizeof(its));
|
memset(&its, 0, sizeof(its));
|
||||||
its.it_value.tv_sec += 0xfffffff0; // end of time - 0xf
|
its.it_value.tv_sec = 0x7ffffff0; // end of time - 0xf
|
||||||
if (timerfd_settime(realtime_fd,
|
if (timerfd_settime(realtime_fd,
|
||||||
TFD_TIMER_ABSTIME | TFD_TIMER_CANCELON_SET,
|
TFD_TIMER_ABSTIME | TFD_TIMER_CANCELON_SET,
|
||||||
&its, NULL) < 0)
|
&its, NULL) < 0)
|
||||||
|
|
Loading…
Reference in New Issue