diff options
Diffstat (limited to 'ntpd/refclock_heath.c')
-rw-r--r-- | ntpd/refclock_heath.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/ntpd/refclock_heath.c b/ntpd/refclock_heath.c index cd74eca3173d..435d8f6c4ffb 100644 --- a/ntpd/refclock_heath.c +++ b/ntpd/refclock_heath.c @@ -222,12 +222,13 @@ heath_start( * Open serial port */ snprintf(device, sizeof(device), DEVICE, unit); - if (!(fd = refclock_open(device, speed[peer->ttl & 0x3], - LDISC_REMOTE))) + fd = refclock_open(device, speed[peer->ttl & 0x3], + LDISC_REMOTE); + if (fd <= 0) return (0); pp = peer->procptr; pp->io.clock_recv = heath_receive; - pp->io.srcclock = (caddr_t)peer; + pp->io.srcclock = peer; pp->io.datalen = 0; pp->io.fd = fd; if (!io_addclock(&pp->io)) { @@ -240,7 +241,6 @@ heath_start( * Initialize miscellaneous variables */ peer->precision = PRECISION; - peer->burst = NSTAGE; pp->clockdesc = DESCRIPTION; memcpy(&pp->refid, REFID, 4); return (1); @@ -282,7 +282,7 @@ heath_receive( /* * Initialize pointers and read the timecode and timestamp */ - peer = (struct peer *)rbufp->recv_srcclock; + peer = rbufp->recv_peer; pp = peer->procptr; pp->lencode = refclock_gtlin(rbufp, pp->a_lastcode, BMAX, &trtmp); @@ -430,8 +430,6 @@ heath_poll( if (write(pp->io.fd, "T", 1) != 1) refclock_report(peer, CEVNT_FAULT); ioctl(pp->io.fd, TIOCMBIS, (char *)&bits); - if (peer->burst > 0) - return; if (pp->coderecv == pp->codeproc) { refclock_report(peer, CEVNT_TIMEOUT); return; @@ -444,7 +442,6 @@ heath_poll( printf("heath: timecode %d %s\n", pp->lencode, pp->a_lastcode); #endif - peer->burst = MAXSTAGE; pp->polls++; } |