http://defect.opensolaris.org/bz/show_bug.cgi?id=11784
Michael Hunter <michael.hunter at sun.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |michael.hunter at sun.com
--- Comment #4 from Michael Hunter <michael.hunter at sun.com> 2009-10-07
14:38:54 UTC ---
(In reply to comment #3)
> (In reply to comment #2)
> > If (e->event_time - now) == 0, we cancel the alarm. It might make sense to
> > ensure a minimal alarm time of 1sec, i.e.
> >
> > nextalarm = e->event_time - now;
> > if (nextalarm > 0)
> > (void) alarm(nextalarm)
> > else
> > (void) alarm(1);
>
> I was thinking that if nextalarm is 0, we don't set the alarm at all. The
> alarm for that event has already been registered, so it should go off in the
> same second.
What is wrong with doing it right now? You don't know if there is an alarm
scheduled soon. The event added could have been the one that was in the past
due to scheduling delays.
if (e->event_time > now)
(void) alarm(e->event_time - now);
else
(void) kill(0, SIGALRM);
Make sure that the interval math is right if unsigneds are involved.
--
Configure bugmail: http://defect.opensolaris.org/bz/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.