diff options
author | roberto <roberto@FreeBSD.org> | 2008-08-22 15:58:00 +0000 |
---|---|---|
committer | roberto <roberto@FreeBSD.org> | 2008-08-22 15:58:00 +0000 |
commit | b85c7169a740b2edf0106ad59fdaa1b0160f823c (patch) | |
tree | 2b9fb7f64eacb322e95695e412c923e97ba33e88 /contrib/ntp/ntpd/refclock_leitch.c | |
parent | 1d197cfe9feac6bc29537d8e53c30b6435937b95 (diff) | |
parent | 7a6072eb585696f8856cd498c3fd194cf49f14c6 (diff) | |
download | FreeBSD-src-b85c7169a740b2edf0106ad59fdaa1b0160f823c.zip FreeBSD-src-b85c7169a740b2edf0106ad59fdaa1b0160f823c.tar.gz |
Merge ntpd & friends 4.2.4p5 from vendor/ntp/dist into head. Next commit
will update usr.sbin/ntp to match this.
MFC after: 2 weeks
Diffstat (limited to 'contrib/ntp/ntpd/refclock_leitch.c')
-rw-r--r-- | contrib/ntp/ntpd/refclock_leitch.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/contrib/ntp/ntpd/refclock_leitch.c b/contrib/ntp/ntpd/refclock_leitch.c index d7cd9bb..e1ba0c4 100644 --- a/contrib/ntp/ntpd/refclock_leitch.c +++ b/contrib/ntp/ntpd/refclock_leitch.c @@ -48,14 +48,20 @@ #define LEITCH_DESCRIPTION "Leitch: CSD 5300 Master Clock System Driver" #define LEITCH232 "/dev/leitch%d" /* name of radio device */ #define SPEED232 B300 /* uart speed (300 baud) */ +#ifdef DEBUG #define leitch_send(A,M) \ if (debug) fprintf(stderr,"write leitch %s\n",M); \ if ((write(A->leitchio.fd,M,sizeof(M)) < 0)) {\ - if (debug) \ - fprintf(stderr, "leitch_send: unit %d send failed\n", A->unit); \ - else \ - msyslog(LOG_ERR, "leitch_send: unit %d send failed %m",A->unit);} - + if (debug) \ + fprintf(stderr, "leitch_send: unit %d send failed\n", A->unit); \ + else \ + msyslog(LOG_ERR, "leitch_send: unit %d send failed %m",A->unit);} +#else +#define leitch_send(A,M) \ +if ((write(A->leitchio.fd,M,sizeof(M)) < 0)) {\ + msyslog(LOG_ERR, "leitch_send: unit %d send failed %m",A->unit);} +#endif + #define STATE_IDLE 0 #define STATE_DATE 1 #define STATE_TIME1 2 @@ -166,7 +172,7 @@ leitch_poll( if (debug) fprintf(stderr, "leitch_poll()\n"); #endif - if (unit > MAXUNITS) { + if (unit >= MAXUNITS) { /* XXXX syslog it */ return; } |