patches/gpsd-02-solaris.diff
author jurikm
Sun, 12 Feb 2012 14:04:10 +0000
changeset 8245 383896da4129
parent 7856 c4d8c397b51c
permissions -rw-r--r--
SFEsauerbraten.spec: add IPS package name

--- gpsd-2.96/libgpsd_core.c	Fri Mar 18 16:41:04 2011
+++ gpsd-2.96-patch/libgpsd_core.c	Sat Oct 29 16:02:19 2011
@@ -1597,3 +1597,48 @@
     out->satellites_visible = 0;
     clear_dop(&out->dop);
 }
+
+#ifdef __sun
+/*
+ * On solaris no timegm function exists,
+ * we must implement it here
+ */
+time_t timegm(struct tm *t)
+{
+    time_t tl, tb;
+    struct tm *tg;
+
+    tl = mktime (t);
+     if (tl == -1)
+    {
+        t->tm_hour--;
+        tl = mktime (t);
+        if (tl == -1)
+            return -1; /* can't deal with output from strptime */
+        tl += 3600;
+    }
+    tg = gmtime (&tl);
+    tg->tm_isdst = 0;
+    tb = mktime (tg);
+    if (tb == -1)
+    {
+        tg->tm_hour--;
+        tb = mktime (tg);
+        if (tb == -1)
+            return -1; /* can't deal with output from gmtime */
+        tb += 3600;
+    }
+    return (tl - (tb - tl));
+}
+
+void cfmakeraw (struct termios *termios_p)
+{
+    termios_p->c_iflag &= ~(IGNBRK|BRKINT|PARMRK|ISTRIP
+                            |INLCR|IGNCR|ICRNL|IXON);
+    termios_p->c_oflag &= ~OPOST;
+    termios_p->c_lflag &= ~(ECHO|ECHONL|ICANON|ISIG|IEXTEN);
+    termios_p->c_cflag &= ~(CSIZE|PARENB);
+    termios_p->c_cflag |= CS8;
+}
+#endif
+
--- gpsd-2.96/gpsctl.c	Tue Mar 15 04:34:32 2011
+++ gpsd-2.96-patch/gpsctl.c	Sat Oct 29 16:03:57 2011
@@ -4,6 +4,9 @@
  * BSD terms apply: see the file COPYING in the distribution root for details.
  *
  */
+
+#define BSD_COMP
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <stdbool.h>
--- gpsd-2.96/gpspipe.c	Thu Jan 13 14:36:18 2011
+++ gpsd-2.96-patch/gpspipe.c	Sat Oct 29 16:02:19 2011
@@ -45,6 +45,7 @@
 
 static struct gps_data_t gpsdata;
 static void spinner(unsigned int, unsigned int);
+static void cfmakeraw (struct termios *termios_p);
 
 /* NMEA-0183 standard baud rate */
 #define BAUDRATE B4800
@@ -384,3 +385,16 @@
     (void)fflush(stderr);
     return;
 }
+
+#ifdef __sun
+static void cfmakeraw (struct termios *termios_p)
+{
+    termios_p->c_iflag &= ~(IGNBRK|BRKINT|PARMRK|ISTRIP
+                            |INLCR|IGNCR|ICRNL|IXON);
+    termios_p->c_oflag &= ~OPOST;
+    termios_p->c_lflag &= ~(ECHO|ECHONL|ICANON|ISIG|IEXTEN);
+    termios_p->c_cflag &= ~(CSIZE|PARENB);
+    termios_p->c_cflag |= CS8;
+}
+#endif
+
--- gpsd-2.96/gpxlogger.c	Tue Mar 15 04:34:32 2011
+++ gpsd-2.96-patch/gpxlogger.c	Sat Oct 29 16:10:30 2011
@@ -353,7 +353,7 @@
     while ((ch = getopt(argc, argv, "dD:f:hi:m:V")) != -1) {
 	switch (ch) {
 	case 'd':
-	    openlog(basename(progname), LOG_PID | LOG_PERROR, LOG_DAEMON);
+	    openlog(basename(progname), LOG_PID | LOG_ERR, LOG_DAEMON);
 	    daemonize = true;
 	    break;
 #ifdef CLIENTDEBUG_ENABLE