since we now have ldattach which can relay data while activating the
timing line disciplines, i can rip this out of gpsd - the patches are
already committed upstream.
Index: Makefile
===================================================================
RCS file: /cvs/ports/misc/gpsd/Makefile,v
retrieving revision 1.23
diff -u -p -u -r1.23 Makefile
--- Makefile 16 Apr 2008 06:53:35 -0000 1.23
+++ Makefile 13 Jun 2008 03:59:30 -0000
@@ -7,7 +7,7 @@ COMMENT-python= python bindings for gps
VERSION= 2.37
DISTNAME= gpsd-${VERSION}
-PKGNAME-main= gpsd-${VERSION}p0
+PKGNAME-main= gpsd-${VERSION}p1
PKGNAME-motif= gpsd-motif-${VERSION}
PKGNAME-php= gpsd-php-${VERSION}
PKGNAME-python= gpsd-python-${VERSION}p0
Index: patches/patch-drivers_c
===================================================================
RCS file: patches/patch-drivers_c
diff -N patches/patch-drivers_c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-drivers_c 13 Jun 2008 03:59:30 -0000
@@ -0,0 +1,50 @@
+$OpenBSD$
+--- drivers.c.orig Mon Jan 21 11:35:31 2008
++++ drivers.c Wed Jun 11 15:14:20 2008
+@@ -102,46 +102,6 @@ gps_mask_t nmea_parse_input(struct gps_device_t *sessi
+ #endif /* NON_NMEA_ENABLE */
+ gpsd_report(LOG_WARN, "unknown sentence: \"%s\"\n",
session->packet.outbuffer);
+ }
+-#ifdef NMEADISC
+- if (session->ldisc == 0) {
+- uid_t old;
+- int ldisc = NMEADISC;
+-
+-#ifdef TIOCSTSTAMP
+- struct tstamps tstamps;
+-#ifdef PPS_ON_CTS
+- tstamps.ts_set |= TIOCM_CTS;
+-#else /*!PPS_ON_CTS */
+- tstamps.ts_set |= TIOCM_CAR;
+-#endif /* PPS_ON_CTS */
+- tstamps.ts_clr = 0;
+-
+- old = geteuid();
+- if (seteuid(0) == -1)
+- gpsd_report(LOG_WARN, "can't seteuid(0) - %s", strerror(errno));
+- else
+- gpsd_report(LOG_WARN, "seteuid(0) to enable timestamping\n");
+- if (ioctl(session->gpsdata.gps_fd, TIOCSTSTAMP, &tstamps) < 0)
+- gpsd_report(LOG_WARN, "can't set kernel timestamping: %s\n",
+- strerror(errno));
+- else
+- gpsd_report(LOG_WARN, "activated kernel timestamping\n");
+-#endif /* TIOCSTSTAMP */
+- if (ioctl(session->gpsdata.gps_fd, TIOCSETD, &ldisc) == -1)
+- gpsd_report(LOG_WARN, "can't set nmea discipline: %s\n",
+- strerror(errno));
+- else
+- gpsd_report(LOG_WARN, "activated nmea discipline\n");
+- /* this is a flag that shows if we've tried the setup */
+- session->ldisc = NMEADISC;
+-
+- if (old){
+- gpsd_report(LOG_WARN, "giving up euid 0\n");
+- (void)seteuid(old);
+- }
+- gpsd_report(LOG_WARN, "running with effective user ID %d\n", geteuid());
+- }
+-#endif /*NMEADISC */
+ #ifdef NTPSHM_ENABLE
+ /* this magic number is derived from observation */
+ if (session->context->enable_ntpshm &&
Index: patches/patch-gpsd_xml
===================================================================
RCS file: patches/patch-gpsd_xml
diff -N patches/patch-gpsd_xml
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-gpsd_xml 13 Jun 2008 03:59:30 -0000
@@ -0,0 +1,18 @@
+$OpenBSD$
+--- gpsd.xml.orig Mon Jan 21 11:35:31 2008
++++ gpsd.xml Wed Jun 11 15:14:20 2008
+@@ -780,13 +780,7 @@ of every clock second on the carrier-detect lines of s
+ GPSes; this pulse can be used to update NTP at much higher accuracy
+ than message time provides. You can determine whether your GPS emits
+ this pulse by running at -D 5 and watching for carrier-detect state
+-change messages in the logfile. On OpenBSD <application>gpsd</application>
+-makes use of the nmea(4) line discipline and the tty(4) timestamping
+-facilities to export PPS time via the sensors framework. OpenBSD's ntpd
+-uses these sensors to adjust the hardware clock and frequency. To make
+-use of this feature, <application>gpsd</application> must be started
+-as root so it can activate the timestamping and line discipline; after
+-attempting to set up PPS, it will relinquish root privileges.</para>
++change messages in the logfile.</para>
+
+ <para>When <application>gpsd</application> receives a sentence with a
+ timestamp, it packages the received timestamp with current local time