1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
|
Description: replace termio usage with termios
Author: David da Silva Polverari <polverari@debian.org>
Last-Update: 2026-03-04
--- a/src/gps/garminserial.c
+++ b/src/gps/garminserial.c
@@ -31,8 +31,7 @@
#include "Garmin.h"
#include <sys/types.h>
#include <fcntl.h>
-#include <termio.h>
-#include <sys/termios.h>
+#include <termios.h>
#ifdef SUNOS41
#include <sys/filio.h>
@@ -44,7 +43,7 @@
/* define global variables */
int ttyfp;
-struct termio ttyset;
+struct termios ttyset;
/****************************************************************************/
@@ -60,7 +59,7 @@
/* return when error opening device */
if (ttyfp < 0)
return (-1);
- if (ioctl (ttyfp, TCGETA, &ttyset) < 0)
+ if (ioctl (ttyfp, TCGETS, &ttyset) < 0)
return (-1);
/* set baud rate for device */
@@ -89,7 +88,7 @@
ttyset.c_oflag = (ONLRET);
/* return if unable to set communication parameters */
- if (ioctl (ttyfp, TCSETAF, &ttyset) < 0)
+ if (ioctl (ttyfp, TCSETSF, &ttyset) < 0)
return (-1);
return 0;
|