[Orca-dev] Orcallator.se timestamp patch bug and patch

John Garner jcgarner at douglas.co.us
Sun Jul 18 11:27:46 PDT 2004


All,

I noticed that after the timestamp patch, orcallator would start to 
freeze up after a while. `truss` showed that it was simply sleeping, but 
for a very long time.

Inserting a few fprintf's showed that the time_to_sleep variable would 
occasionally get set to some huge number... The type of number that you 
get when you take a negative int and cast it to an unsigned long int :-) 
(this can occur if xntpd sets the clock forward or se gets hung up for a 
brief moment by the scheduler)

The fix in my case was to simply not declare time_to_sleep as an 
unsigned long (we should never be sleeping more than 2 billion seconds 
anyway :-)

The unified diff follows

--john



--- orcallator.se.362   Sun Jul 18 12:15:12 2004
+++ orcallator.se.new   Sun Jul 18 12:19:01 2004
@@ -1204,7 +1204,7 @@
 orca_sleep_till(long sleep_till)
 {
   timeval_t now[1];
-  ulong     time_to_sleep;
+  long     time_to_sleep;

   gettimeofday(now, 0);
   time_to_sleep = sleep_till - now[0].tv_sec;



Blair Zajac wrote:

>
> Dmitry,
>
> Great patch.  Thanks for submitting it.
>
> I've added it to the Orca Subversion tree in revision 362:
>
> http://www.orcaware.com/pipermail/orca-checkins/2004-June/000241.html
>
> What other changes did you want to make to Orca?
>
> Best,
> Blair
>




More information about the Orca-dev mailing list