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

« back to all changes in this revision

Viewing changes to ntpd/refclock_heath.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:
221
221
        /*
222
222
         * Open serial port
223
223
         */
224
 
        sprintf(device, DEVICE, unit);
 
224
        snprintf(device, sizeof(device), DEVICE, unit);
225
225
        if (!(fd = refclock_open(device, speed[peer->ttl & 0x3],
226
226
            LDISC_REMOTE)))
227
227
                return (0);
231
231
        pp->io.datalen = 0;
232
232
        pp->io.fd = fd;
233
233
        if (!io_addclock(&pp->io)) {
234
 
                (void) close(fd);
 
234
                close(fd);
 
235
                pp->io.fd = -1;
235
236
                return (0);
236
237
        }
237
238
 
241
242
        peer->precision = PRECISION;
242
243
        peer->burst = NSTAGE;
243
244
        pp->clockdesc = DESCRIPTION;
244
 
        memcpy((char *)&pp->refid, REFID, 4);
 
245
        memcpy(&pp->refid, REFID, 4);
245
246
        return (1);
246
247
}
247
248
 
258
259
        struct refclockproc *pp;
259
260
 
260
261
        pp = peer->procptr;
261
 
        io_closeclock(&pp->io);
 
262
        if (-1 != pp->io.fd)
 
263
                io_closeclock(&pp->io);
262
264
}
263
265
 
264
266