summaryrefslogtreecommitdiff
path: root/gdb/event-loop.c
diff options
context:
space:
mode:
authorElena Zannoni <ezannoni@kwikemart.cygnus.com>2000-03-06 17:07:03 +0000
committerElena Zannoni <ezannoni@kwikemart.cygnus.com>2000-03-06 17:07:03 +0000
commit960e0f63dd3deada8ee9090c940ba805dd66046d (patch)
tree898d7cdf3b383dad735d8c09db241328f98b1253 /gdb/event-loop.c
parent30ac34c20f3433ce38ab6638a41adf93ad825c81 (diff)
downloadgdb-960e0f63dd3deada8ee9090c940ba805dd66046d.tar.gz
2000-03-06 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
From Eli Zaretskii <eliz@is.elta.co.il>: * event-loop.c (poll_timers): Don't compare delta.tv_sec with zero, since time_t might be unsigned.
Diffstat (limited to 'gdb/event-loop.c')
-rw-r--r--gdb/event-loop.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/gdb/event-loop.c b/gdb/event-loop.c
index dd849dfb8ff..d6babc24ff2 100644
--- a/gdb/event-loop.c
+++ b/gdb/event-loop.c
@@ -1114,8 +1114,11 @@ poll_timers (void)
}
/* Oops it expired already. Tell select / poll to return
- immediately. */
- if (delta.tv_sec < 0)
+ immediately. (Cannot simply test if delta.tv_sec is negative
+ because time_t might be unsigned.) */
+ if (timer_list.first_timer->when.tv_sec < time_now.tv_sec
+ || (timer_list.first_timer->when.tv_sec == time_now.tv_sec
+ && timer_list.first_timer->when.tv_usec < time_now.tv_usec))
{
delta.tv_sec = 0;
delta.tv_usec = 0;