2000-03-06 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
authorElena Zannoni <ezannoni@kwikemart.cygnus.com>
Mon, 6 Mar 2000 17:07:03 +0000 (17:07 +0000)
committerElena Zannoni <ezannoni@kwikemart.cygnus.com>
Mon, 6 Mar 2000 17:07:03 +0000 (17:07 +0000)
        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.

gdb/ChangeLog
gdb/event-loop.c

index 4e9b0c251cc0ca2268383c354e9ece5528bf9872..405bdbb1162b2d168965efcc637ea7e04c0a5c09 100644 (file)
@@ -1,3 +1,10 @@
+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.
+
 2000-03-06  Mark Kettenis  <kettenis@gnu.org>
 
        * i386-linux-nat.c (supply_fpregset): Mask off the reserved bits
index dd849dfb8ff81b04e015ed1cb1ac71a0f9e51cd2..d6babc24ff2f8f00ccd7cd73c9a6a85aadd09ae4 100644 (file)
@@ -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;