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

« back to all changes in this revision

Viewing changes to ntpd/refclock_shm.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:
137
137
        HANDLE shmid=0;
138
138
        SECURITY_DESCRIPTOR sd;
139
139
        SECURITY_ATTRIBUTES sa;
140
 
        sprintf (buf,"NTP%d",unit);
141
 
        if (unit>=2) { /* world access */
 
140
        snprintf(buf, sizeof(buf), "NTP%d", unit);
 
141
        if (unit >= 2) { /* world access */
142
142
                if (!InitializeSecurityDescriptor(&sd, SECURITY_DESCRIPTOR_REVISION)) {
143
143
                        msyslog(LOG_ERR,"SHM InitializeSecurityDescriptor (unit %d): %m",unit);
144
144
                        return 0;
193
193
        pp->io.datalen = 0;
194
194
        pp->io.fd = -1;
195
195
 
196
 
        up = (struct shmunit *) emalloc(sizeof(*up));
197
 
        if (up == NULL)
198
 
                return (FALSE);
199
 
        memset((char *)up, 0, sizeof(*up));
 
196
        up = emalloc(sizeof(*up));
 
197
        memset(up, 0, sizeof(*up));
200
198
        pp->unitptr = (caddr_t)up;
201
199
 
202
200
        up->shm = getShmTime(unit);
233
231
 
234
232
        pp = peer->procptr;
235
233
        up = (struct shmunit *)pp->unitptr;
 
234
 
 
235
        if (NULL == up)
 
236
                return;
236
237
#ifndef SYS_WINNT
237
238
        /* HMS: shmdt()wants char* or const void * */
238
239
        (void) shmdt ((char *)up->shm);
239
240
#else
240
241
        UnmapViewOfFile (up->shm);
241
242
#endif
 
243
        free(up);
242
244
}
243
245
 
244
246