mirror of
https://github.com/git/git.git
synced 2026-03-13 18:33:25 +01:00
Fix setitimer implementation.
Although we made sure that in->it_interval is either zero or equal to in->it_value, we were still using in->it_interval to compute the timeout, which could be zero, for example, with git-log's --early-output flag. Use in->it_value instead. On the otherhand, we used in->it_value to check for a single-shot timer. Use in->it_interval instead. Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
This commit is contained in:
@@ -978,8 +978,8 @@ int setitimer(int type, struct itimerval *in, struct itimerval *out)
|
||||
is_timeval_eq(&in->it_interval, &zero))
|
||||
return 0;
|
||||
|
||||
timer_interval = in->it_interval.tv_sec * 1000 + in->it_interval.tv_usec / 1000;
|
||||
one_shot = is_timeval_eq(&in->it_value, &zero);
|
||||
timer_interval = in->it_value.tv_sec * 1000 + in->it_value.tv_usec / 1000;
|
||||
one_shot = is_timeval_eq(&in->it_interval, &zero);
|
||||
if (!atexit_done) {
|
||||
atexit(stop_timer_thread);
|
||||
atexit_done = 1;
|
||||
|
||||
Reference in New Issue
Block a user