Files
2022-03-11 18:26:24 +00:00

45 lines
1.4 KiB
Plaintext

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"
@@ -416,6 +419,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)
@@ -641,9 +655,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':