9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] timesync is slow to set the time after boot
@ 2003-03-15  6:48 Richard Powell
  2003-03-15 12:49 ` David Presotto
  2003-03-15 18:00 ` David Presotto
  0 siblings, 2 replies; 5+ messages in thread
From: Richard Powell @ 2003-03-15  6:48 UTC (permalink / raw)
  To: 9fans

Hello 9fans,

I've noticed that timesync takes a minute or so to set the system time from the PC clock after a boot.  It seems that it 
  ignores the first sample from the clock and sleeps for a minute before setting the time from a second sample.  I've 
included a diff just to illustrate the issue.  Does anyone know the circumstances that led to this?  Are there 
problematic clocks out there:-)  Maybe we could restrict the dalay to the cases where it's needed.

Thanks,
Richard



diff -c timesync.org timesync.c.mod
*** timesync.org        Fri Mar 14 19:42:32 2003
--- timesync.c.mod      Fri Mar 14 19:42:32 2003
***************
*** 375,382 ****
                         s->stime = s->ltime + diff;

                 // if the sample was bad or if this is the first sample, ignore it
!               if(s->stime < 0 || !already){
!                       already = 1;
                         free(s);
                         continue;
                 }
--- 375,383 ----
                         s->stime = s->ltime + diff;

                 // if the sample was bad or if this is the first sample, ignore it
!       //      if(s->stime < 0 || !already){
!       //              already = 1;
!               if(s->stime < 0){
                         free(s);
                         continue;
                 }



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2003-03-16 13:28 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-03-15  6:48 [9fans] timesync is slow to set the time after boot Richard Powell
2003-03-15 12:49 ` David Presotto
2003-03-15 18:00 ` David Presotto
2003-03-16  8:15   ` Richard Powell
2003-03-16 13:28     ` David Presotto

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).