]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
[Bug 2678] nmea_control() now checks 'refclock_params()' result.
authorJuergen Perlinger <perlinger@ntp.org>
Mon, 1 Dec 2014 23:37:46 +0000 (00:37 +0100)
committerJuergen Perlinger <perlinger@ntp.org>
Mon, 1 Dec 2014 23:37:46 +0000 (00:37 +0100)
bk: 547cfbcam6WZp9-qBSh0JoM0V9eYpA

ChangeLog
ntpd/refclock_nmea.c

index 09bc5c579e9ad81bf25ad2d33ac135ecca1239c6..056fb6705052ea207665ab671f015d5b86dca15e 100644 (file)
--- 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 <stenn@ntp.org>
 * [Bug 2314] Only enable PPS if kernel consumer binding succeeds.
 * [Bug 2314] Kernel PPS binding EOPNOTSUPP is a failure condition. 
index abe310842e4406f82366456e6b70fb1071e51ddb..58867f47b3d53614294e937b26c5a9db6e75cc65 100644 (file)
@@ -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",