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

« back to all changes in this revision

Viewing changes to ntpd/refclock_chronolog.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:
104
104
         * Open serial port. Don't bother with CLK line discipline, since
105
105
         * it's not available.
106
106
         */
107
 
        (void)sprintf(device, DEVICE, unit);
 
107
        snprintf(device, sizeof(device), DEVICE, unit);
108
108
#ifdef DEBUG
109
109
        if (debug)
110
110
                printf ("starting Chronolog with device %s\n",device);
115
115
        /*
116
116
         * Allocate and initialize unit structure
117
117
         */
118
 
        if (!(up = (struct chronolog_unit *)
119
 
              emalloc(sizeof(struct chronolog_unit)))) {
120
 
                (void) close(fd);
121
 
                return (0);
122
 
        }
123
 
        memset((char *)up, 0, sizeof(struct chronolog_unit));
 
118
        up = emalloc(sizeof(*up));
 
119
        memset(up, 0, sizeof(*up));
124
120
        pp = peer->procptr;
125
121
        pp->unitptr = (caddr_t)up;
126
122
        pp->io.clock_recv = chronolog_receive;
128
124
        pp->io.datalen = 0;
129
125
        pp->io.fd = fd;
130
126
        if (!io_addclock(&pp->io)) {
131
 
                (void) close(fd);
 
127
                close(fd);
 
128
                pp->io.fd = -1;
132
129
                free(up);
 
130
                pp->unitptr = NULL;
133
131
                return (0);
134
132
        }
135
133
 
157
155
 
158
156
        pp = peer->procptr;
159
157
        up = (struct chronolog_unit *)pp->unitptr;
160
 
        io_closeclock(&pp->io);
161
 
        free(up);
 
158
        if (-1 != pp->io.fd)
 
159
                io_closeclock(&pp->io);
 
160
        if (NULL != up)
 
161
                free(up);
162
162
}
163
163
 
164
164