From: Reg Clemens Date: Thu, 1 Nov 2007 07:24:16 +0000 (-0400) Subject: The original version of LinuxPPS did not comply with the PPSAPI and required X-Git-Tag: NTP_4_2_5P95~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0bc001bf47c0071d19c39ea616af77cdf7eee6a1;p=thirdparty%2Fntp.git The original version of LinuxPPS did not comply with the PPSAPI and required some changes to the startup code in refclock_oncore.c . The current version complies, and these changes can be removed. bk: 47297f20df_QqzbkuuUEC8HOuiw48Q --- diff --git a/ntpd/refclock_oncore.c b/ntpd/refclock_oncore.c index 75c20974f..08ad41aa0 100644 --- a/ntpd/refclock_oncore.c +++ b/ntpd/refclock_oncore.c @@ -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) {