9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: David Presotto <presotto@closedmind.org>
To: 9fans@cse.psu.edu
Subject: Re: [9fans] timesync is slow to set the time after boot
Date: Sat, 15 Mar 2003 13:00:54 -0500	[thread overview]
Message-ID: <0c96ecd2b95642b0199eacca2aaea7ba@plan9.bell-labs.com> (raw)
In-Reply-To: <3E72CCA8.2030605@powell.name>

[-- Attachment #1: Type: text/plain, Size: 225 bytes --]

I stopped ignoring the first sample.  It made some difference since the
first sample is usually perverted a bit by the system starting up.  However,
it really doesn't help to have a wrong time for a minute.   Thanks powell.

[-- Attachment #2: Type: message/rfc822, Size: 3105 bytes --]

From: Richard Powell <richard@powell.name>
To: 9fans <9fans@cse.psu.edu>
Subject: [9fans] timesync is slow to set the time after boot
Date: Fri, 14 Mar 2003 22:48:08 -0800
Message-ID: <3E72CCA8.2030605@powell.name>

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;
                 }

  parent reply	other threads:[~2003-03-15 18:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-03-15  6:48 Richard Powell
2003-03-15 12:49 ` David Presotto
2003-03-15 18:00 ` David Presotto [this message]
2003-03-16  8:15   ` Richard Powell
2003-03-16 13:28     ` David Presotto

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0c96ecd2b95642b0199eacca2aaea7ba@plan9.bell-labs.com \
    --to=presotto@closedmind.org \
    --cc=9fans@cse.psu.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).