Author: jackburton Date: 2010-02-17 10:12:43 +0100 (Wed, 17 Feb 2010) New Revision: 35505 Changeset: http://dev.haiku-os.org/changeset/35505/haiku Modified: haiku/trunk/src/system/kernel/timer.cpp Log: set_hardware_timer() would sometimes (on boot) pass a negative timeout to arch_timer_set_hardware_timer(). This was harmless, at least with our current x86 timers implementation, since they checked for minimum timeouts. Very small cleanup (now that the file is compiled as C++). Modified: haiku/trunk/src/system/kernel/timer.cpp =================================================================== --- haiku/trunk/src/system/kernel/timer.cpp 2010-02-17 00:46:43 UTC (rev 35504) +++ haiku/trunk/src/system/kernel/timer.cpp 2010-02-17 09:12:43 UTC (rev 35505) @@ -147,8 +147,11 @@ // setup the next hardware timer if (cpuData.events != NULL) { - arch_timer_set_hardware_timer( - (bigtime_t)cpuData.events->schedule_time - system_time()); + bigtime_t timeout = (bigtime_t)cpuData.events->schedule_time + - system_time(); + if (timeout <= 0) + timeout = 1; + arch_timer_set_hardware_timer(timeout); } release_spinlock(spinlock);