From: Juergen Perlinger Date: Mon, 1 Dec 2014 23:37:46 +0000 (+0100) Subject: [Bug 2678] nmea_control() now checks 'refclock_params()' result. X-Git-Tag: NTP_4_2_7P482~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0a3c530174e15e2e4089e6dbfd08f00ff3295391;p=thirdparty%2Fntp.git [Bug 2678] nmea_control() now checks 'refclock_params()' result. bk: 547cfbcam6WZp9-qBSh0JoM0V9eYpA --- diff --git a/ChangeLog b/ChangeLog index 09bc5c579..056fb6705 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,4 @@ +* [Bug 2678] nmea_control() now checks 'refclock_params()' result. (4.2.7p481) 2014/11/22 Released by Harlan Stenn * [Bug 2314] Only enable PPS if kernel consumer binding succeeds. * [Bug 2314] Kernel PPS binding EOPNOTSUPP is a failure condition. diff --git a/ntpd/refclock_nmea.c b/ntpd/refclock_nmea.c index abe310842..58867f47b 100644 --- a/ntpd/refclock_nmea.c +++ b/ntpd/refclock_nmea.c @@ -569,9 +569,19 @@ nmea_control( if (-1 == up->ppsapi_fd) up->ppsapi_fd = pp->io.fd; if (refclock_ppsapi(up->ppsapi_fd, &up->atom)) { - up->ppsapi_lit = TRUE; /* use the PPS API for our own purposes now. */ - refclock_params(pp->sloppyclockflag, &up->atom); + up->ppsapi_lit = refclock_params( + pp->sloppyclockflag, &up->atom); + if (!up->ppsapi_lit) { + /* failed to configure, drop PPS unit */ + time_pps_destroy(up->atom.handle); + msyslog(LOG_WARNING, + "%s set PPSAPI params fails", + refnumtoa(&peer->srcadr)); + } + /* note: the PPS I/O handle remains valid until + * flag1 is cleared or the clock is shut down. + */ } else { msyslog(LOG_WARNING, "%s flag1 1 but PPSAPI fails",