$OpenBSD: patch-src_main_c,v 1.7 2017/05/06 22:00:53 sthen Exp $

Index: src/main.c
--- src/main.c.orig
+++ src/main.c
@@ -23,6 +23,9 @@
 #include <config.h>
 #endif
 
+#include <sys/types.h>
+#include <sys/ioctl.h>
+#include <termios.h>
 #include "port.h"
 #include "minicom.h"
 #include "intl.h"
@@ -333,6 +336,17 @@ nolock:
   /* Set CLOCAL mode */
   m_nohang(portfd);
 
+ /* maybe, just maybe, we're looking at a GPS */
+ do {
+   int nmeadisc = NMEADISC;
+   struct tstamps tstamps;
+
+   tstamps.ts_set = TIOCM_CAR;
+   tstamps.ts_clr = 0;
+   ioctl(portfd, TIOCSETD, &nmeadisc);
+   ioctl(portfd, TIOCSTSTAMP, &tstamps);
+ } while (0);
+
   /* Set Hangup on Close if program crashes. (Hehe) */
   m_hupcl(portfd, 1);
   if (doinit > 0)
@@ -553,9 +567,10 @@ static void show_status_fmt(const char *fmt)
                 bufi += snprintf(buf + bufi, COLS - bufi, "%s",
                                  P_HASDCD[0] == 'Y' ? _("Offline") : _("OFFLINE"));
               else
-                bufi += snprintf(buf + bufi, COLS - bufi, "%s %ld:%ld",
+                bufi += snprintf(buf + bufi, COLS - bufi, "%s %lld:%lld",
                                  P_HASDCD[0] == 'Y' ? _("Online") : _("ONLINE"),
-                                 online / 3600, (online / 60) % 60);
+                                 (long long)(online / 3600),
+                                 (long long)(online / 60) % 60);
               break;
 
             case 'D':
