]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
The original version of LinuxPPS did not comply with the PPSAPI and required
authorReg Clemens <clemens@ntp.org>
Thu, 1 Nov 2007 07:24:16 +0000 (03:24 -0400)
committerReg Clemens <clemens@ntp.org>
Thu, 1 Nov 2007 07:24:16 +0000 (03:24 -0400)
some changes to the startup code in refclock_oncore.c .  The current version
complies, and these changes can be removed.

bk: 47297f20df_QqzbkuuUEC8HOuiw48Q

ntpd/refclock_oncore.c

index 75c20974fea356adb97f74d10ce1acef31cbcc1e..08ad41aa06c924c3a074351d7aa94aebc8d20923 100644 (file)
@@ -535,10 +535,6 @@ oncore_start(
        char device1[STRING_LEN], device2[STRING_LEN], Msg[160];
        const char *cp;
        struct stat stat1, stat2;
-#ifdef PPS_HAVE_FINDSOURCE
-       int ret;
-       char id[STRING_LEN];
-#endif
 
        /* create instance structure for this unit */
 
@@ -589,57 +585,6 @@ oncore_start(
        (void)sprintf(device1, DEVICE1, unit);
        (void)sprintf(device2, DEVICE2, unit);
 
-#ifdef PPS_HAVE_FINDSOURCE
-       /* Try to find the PPS source (by using "index = -1"
-        * we ask just for a generic source)
-        */
-
-       num = fd2 = -1;
-       if ((num=time_pps_findsource(num, device2, STRING_LEN, id, STRING_LEN)) < 0) {
-               sprintf(Msg, "No available PPS source in the system");
-               record_clock_stats(&(instance->peer->srcadr), Msg);
-               exit(1);
-       }
-
-       sprintf(Msg, "Found PPS source #%d \"%s\" on \"%s\"", num, id, device2);
-       record_clock_stats(&(instance->peer->srcadr), Msg);
-
-       /* there are two cases here:
-        *     either there is a device name in device2 and we must open it,
-        *  or there is not, and and it is not a device, and there is nothing
-        *     to open.
-        *  in either case we must use refclock_open to get fd1 opened raw.
-        */
-
-       if (strlen(device2)) {
-               if (stat(device1, &stat1)) {
-                       sprintf(Msg, "Can't stat fd1 (%s)\n", device1);
-                       record_clock_stats(&(instance->peer->srcadr), Msg);
-                       exit(1);
-               }
-
-               if (stat(device2, &stat2)) {
-                       sprintf(Msg, "Can't stat fd2 (%s)\n", device2);
-                       record_clock_stats(&(instance->peer->srcadr), Msg);
-                       exit(1);
-               }
-
-               if ((stat1.st_dev != stat2.st_dev) || (stat1.st_ino != stat2.st_ino)) {
-                       if ((ret=open(device2, O_RDWR)) < 0) {  /* different devices here */
-                               sprintf(Msg, "Can't open fd2 (%s)\n", device2);
-                               record_clock_stats(&(instance->peer->srcadr), Msg);
-                               exit(1);
-                       }
-               }
-       }
-
-       if ((fd1=refclock_open(device1, SPEED, LDISC_RAW)) < 0) {
-               sprintf(Msg, "Can't open fd1 (%s)\n", device1);
-               record_clock_stats(&(instance->peer->srcadr), Msg);
-               exit(1);
-       }
-
-#else
        /* OPEN DEVICES */
        /* opening different devices for fd1 and fd2 presents no problems */
        /* opening the SAME device twice, seems to be OS dependent.
@@ -679,7 +624,7 @@ oncore_start(
                }
        }
        num = fd2;
-#endif
+
        /* open ppsapi soure */
 
        if (time_pps_create(num, &instance->pps_h) < 0) {