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

« back to all changes in this revision

Viewing changes to ntpd/refclock_msfees.c

  • Committer: Bazaar Package Importer
  • Author(s): Kurt Roeckx
  • Date: 2010-05-24 11:09:51 UTC
  • mfrom: (1.2.9 upstream)
  • Revision ID: james.westby@ubuntu.com-20100524110951-1o7gh469ygochf4n
Tags: 1:4.2.6.p1+dfsg-1
* New upstream version
  - They no longer ship arlib, adjust dfsg.patch.
  - Drop kfreebsd.patch, applied upstream
  - Update patches for upstream changes.
* Remove the obsolete config files:

  for ntp:
  - /etc/logcheck/ignore.d.server/ntp, removed in 1:4.2.6+dfsg-1
  - /etc/dhcp3/dhclient-enter-hooks.d/ntp, replaced by exit hooks in
    1:4.2.4p4+dfsg-3
  - /etc/network/if-up.d/ntp, removed in 1:4.2.4p0+dfsg-1

  for ntpdate:
  - /etc/dhcp3/dhclient-enter-hooks.d/ntpdate, replaced by exit hooks in
    1:4.2.4p4+dfsg-3

  Use dpkg 1.15.7.2's dpkg-maintscript-helper.  This needs
  a Pre-Depends to work, else it's never going to be removed.
  (Closes: #569530)
* Add "Depends: ${misc:Depends}" to ntp-doc.

Show diffs side-by-side

added added

removed removed

Lines of Context:
382
382
        int i;
383
383
        register char *ptr = buff;
384
384
 
385
 
        sprintf(ptr, text);
386
 
        for (i=from; i<to; i++)
387
 
        {       while (*ptr) ptr++;
388
 
        if ((ptr-buff) > DUMP_BUF_SIZE) msyslog(LOG_DEBUG, "D: %s", ptr=buff);
389
 
        sprintf(ptr, " %06d", ((int)coffs[i].l_f) / 4295);
 
385
        snprintf(buff, sizeof(buff), text);
 
386
        for (i = from; i < to; i++) {
 
387
                ptr += strlen(ptr);
 
388
                if ((ptr - buff) > DUMP_BUF_SIZE) {
 
389
                        msyslog(LOG_DEBUG, "D: %s", buff);
 
390
                        ptr = buff;
 
391
                }
 
392
                snprintf(ptr, sizeof(buff) - (ptr - buff),
 
393
                         " %06d", ((int)coffs[i].l_f) / 4295);
390
394
        }
391
395
        msyslog(LOG_DEBUG, "D: %s", buff);
392
396
}
450
454
 
451
455
        /* Unit okay, attempt to open the devices.  We do them both at
452
456
         * once to make sure we can */
453
 
        (void) sprintf(eesdev, EES232, unit);
 
457
        snprintf(eesdev, sizeof(eesdev), EES232, unit);
454
458
 
455
459
        fd232 = open(eesdev, O_RDWR, 0777);
456
460
        if (fd232 == -1) {
987
991
 
988
992
        /* Dump the deltas each minute */
989
993
        if (dbg & DB_DUMP_DELTAS)
990
 
        {       if (/*0 <= ees->second && */
991
 
                ees->second < ((sizeof deltas) / (sizeof deltas[0]))) deltas[ees->second] = delta_sfsec;
 
994
        {       
 
995
                if (/*0 <= ees->second && */
 
996
                    ees->second < COUNTOF(deltas))
 
997
                        deltas[ees->second] = delta_sfsec;
992
998
        /* Dump on second 1, as second 0 sometimes missed */
993
999
        if (ees->second == 1) {
994
 
                char text[16 * ((sizeof deltas) / (sizeof deltas[0]))];
 
1000
                char text[16 * COUNTOF(deltas)];
995
1001
                char *cptr=text;
996
1002
                int i;
997
 
                for (i=0; i<((sizeof deltas) / (sizeof deltas[0])); i++) {
998
 
                        sprintf(cptr, " %d.%04d",
999
 
                                msec(deltas[i]), subms(deltas[i]));
1000
 
                        while (*cptr) cptr++;
 
1003
                for (i = 0; i < COUNTOF(deltas); i++) {
 
1004
                        snprintf(cptr, sizeof(text) / COUNTOF(deltas),
 
1005
                                " %d.%04d", msec(deltas[i]),
 
1006
                                subms(deltas[i]));
 
1007
                        cptr += strlen(cptr);
1001
1008
                }
1002
1009
                msyslog(LOG_ERR, "Deltas: %d.%04d<->%d.%04d: %s",
1003
1010
                        msec(EES_STEP_F - EES_STEP_F_GRACE), subms(EES_STEP_F - EES_STEP_F_GRACE),