~ubuntu-branches/debian/squeeze/ntp/squeeze-201010051545

« back to all changes in this revision

Viewing changes to ntpd/refclock_tpro.c

  • Committer: Bazaar Package Importer
  • Author(s): Matt Zimmerman
  • Date: 2004-10-11 16:10:27 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20041011161027-icyjbji8ujym633o
Tags: 1:4.2.0a-10ubuntu2
Use ntp.ubuntulinux.org instead of pool.ntp.org

Show diffs side-by-side

added added

removed removed

Lines of Context:
164
164
         * can't use the sec/usec conversion produced by the driver,
165
165
         * since the year may be suspect. All format error checking is
166
166
         * done by the sprintf() and sscanf() routines.
 
167
         *
 
168
         * Note that the refclockproc usec member has now become nsec.
 
169
         * We could either multiply the read-in usec value by 1000 or
 
170
         * we could pad the written string appropriately and read the
 
171
         * resulting value in already scaled.
167
172
         */
168
173
        sprintf(pp->a_lastcode,
169
174
            "%1x%1x%1x %1x%1x:%1x%1x:%1x%1x.%1x%1x%1x%1x%1x%1x %1x",
179
184
                   pp->a_lastcode);
180
185
#endif
181
186
        if (sscanf(pp->a_lastcode, "%3d %2d:%2d:%2d.%6ld", &pp->day,
182
 
            &pp->hour, &pp->minute, &pp->second, &pp->usec)
 
187
            &pp->hour, &pp->minute, &pp->second, &pp->nsec)
183
188
            != 5) {
184
189
                refclock_report(peer, CEVNT_BADTIME);
185
190
                return;
186
191
        }
 
192
        pp->nsec *= 1000;       /* Convert usec to nsec */
187
193
        if (!tp->status & 0x3)
188
194
                pp->leap = LEAP_NOTINSYNC;
189
195
        else
198
204
                refclock_report(peer, CEVNT_TIMEOUT);
199
205
                return;
200
206
        }
 
207
        refclock_receive(peer);
 
208
        pp->lastref = pp->lastrec;
201
209
        record_clock_stats(&peer->srcadr, pp->a_lastcode);
202
210
        refclock_receive(peer);
203
211
        peer->burst = NSTAGE;