Description: Fix FTBFS: migrate obsolete termio interface to POSIX termios
 glibc no longer ships the obsolete System V <termio.h> header.  The
 garminserial.c source unconditionally includes <termio.h> and uses
 `struct termio' with the TCGETA/TCSETAF ioctls, which made the package
 fail to build with:
   garminserial.c:34:10: fatal error: termio.h: No such file or directory
 Migrate to the POSIX termios interface (functionally equivalent, no user
 visible change): include <termios.h>, use `struct termios' and call
 tcgetattr()/tcsetattr() instead of the removed ioctls.
Author: tangxiaofeng <tangxiaofeng@kylinos.cn>
Origin: vendor
Forwarded: not-needed
Last-Update: 2026-09-02

--- gpstrans-0.41.orig/src/gps/garminserial.c
+++ gpstrans-0.41/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 @@ extern struct PREFS gPrefs;
 
 /* define global variables */
 int ttyfp;
-struct termio ttyset;
+struct termios ttyset;
 
 
 /****************************************************************************/
@@ -60,7 +59,7 @@ serialOpen (enum PROTOCOL p)
   /* return when error opening device */
   if (ttyfp < 0)
     return (-1);
-  if (ioctl (ttyfp, TCGETA, &ttyset) < 0)
+  if (tcgetattr (ttyfp, &ttyset) < 0)
     return (-1);
 
   /* set baud rate for device */
@@ -89,7 +88,7 @@ serialOpen (enum PROTOCOL p)
   ttyset.c_oflag = (ONLRET);
 
   /* return if unable to set communication parameters */
-  if (ioctl (ttyfp, TCSETAF, &ttyset) < 0)
+  if (tcsetattr (ttyfp, TCSAFLUSH, &ttyset) < 0)
     return (-1);
 
   return 0;
