From bfe13b635738de33368a5ce297a981438dfc955b Mon Sep 17 00:00:00 2001 From: Johannes Sixt Date: Mon, 26 Nov 2007 13:14:34 +0100 Subject: [PATCH] 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 --- compat/mingw.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compat/mingw.c b/compat/mingw.c index a25063b7f7..e57c74e0ce 100644 --- a/compat/mingw.c +++ b/compat/mingw.c @@ -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;