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

« back to all changes in this revision

Viewing changes to ntpd/refclock_shm.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:
87
87
        int    valid;
88
88
        int    dummy[10]; 
89
89
};
 
90
 
 
91
struct shmTime *getShmTime(int);
 
92
 
90
93
struct shmTime *getShmTime (int unit) {
91
94
#ifndef SYS_WINNT
92
95
        int shmid=0;
149
152
                return p;
150
153
        }
151
154
#endif
152
 
        return 0;
153
155
}
154
156
/*
155
157
 * shm_start - attach to shared memory
201
203
        pp = peer->procptr;
202
204
        up = (struct shmTime *)pp->unitptr;
203
205
#ifndef SYS_WINNT
204
 
        shmdt (up);
 
206
        /* HMS: shmdt()wants char* or const void * */
 
207
        (void) shmdt (up);
205
208
#else
206
209
        UnmapViewOfFile (up);
207
210
#endif
272
275
                        pp->hour=t->tm_hour;
273
276
                        pp->minute=t->tm_min;
274
277
                        pp->second=t->tm_sec;
275
 
                        pp->msec=0;
276
 
                        pp->usec=tvt.tv_usec;
 
278
                        pp->nsec=tvt.tv_usec * 1000;
277
279
                        peer->precision=up->precision;
278
280
                        pp->leap=up->leap;
279
281
                } 
285
287
        }
286
288
        else {
287
289
                refclock_report(peer, CEVNT_TIMEOUT);
 
290
                /*
288
291
                msyslog (LOG_NOTICE, "SHM: no new value found in shared memory");
 
292
                */
289
293
                return;
290
294
        }
291
295
        if (!refclock_process(pp)) {
292
296
                refclock_report(peer, CEVNT_BADTIME);
293
297
                return;
294
298
        }
 
299
        pp->lastref = pp->lastrec;
295
300
        refclock_receive(peer);
296
301
}
297
302