[packages/comgt] Rel 3
arekm
arekm at pld-linux.org
Wed May 20 23:30:06 CEST 2026
commit f6698866b524756785111aa9b1ed80820e5286b7
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date: Wed May 20 23:29:47 2026 +0200
Rel 3
comgt-termios.patch | 117 ++++++++++++++++++++++++++++++++++++++++++++++++++++
comgt.spec | 4 +-
2 files changed, 120 insertions(+), 1 deletion(-)
---
diff --git a/comgt.spec b/comgt.spec
index 03e6815..1aa62b5 100644
--- a/comgt.spec
+++ b/comgt.spec
@@ -2,7 +2,7 @@ Summary: Controlling, configuring and interacting with Option Wireless 3G and 2G
#Summary(pl.UTF-8):
Name: comgt
Version: 0.32
-Release: 2
+Release: 3
License: GPL v2
Group: Utilities
Source0: http://dl.sourceforge.net/comgt/%{name}.%{version}.tgz
@@ -10,6 +10,7 @@ Source0: http://dl.sourceforge.net/comgt/%{name}.%{version}.tgz
Source1: %{name}-configure.ac
Source2: %{name}-Makefile.am
Patch0: %{name}-scriptdir.patch
+Patch1: %{name}-termios.patch
URL: http://sourceforge.net/projects/comgt
BuildRequires: autoconf >= 2.62
BuildRequires: automake
@@ -25,6 +26,7 @@ GSM) data devices within the Linux environment.
%prep
%setup -q -n %{name}.%{version}
%patch -P0 -p1
+%patch -P1 -p1
cp -f %{SOURCE1} configure.ac
cp -f %{SOURCE2} Makefile.am
diff --git a/comgt-termios.patch b/comgt-termios.patch
new file mode 100644
index 0000000..c3f5dc8
--- /dev/null
+++ b/comgt-termios.patch
@@ -0,0 +1,117 @@
+--- comgt.0.32/comgt.c.orig
++++ comgt.0.32/comgt.c
+@@ -30,7 +30,7 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <signal.h>
+-#include <termio.h>
++#include <termios.h>
+ #include <fcntl.h>
+ #include <unistd.h>
+ #include <string.h>
+@@ -84,7 +84,7 @@
+ char scriptfile[MAXPATH]; /* Script file name */
+ char scriptfilepath[MAXPATH]; /* temp storage for full path */
+ BOOL verbose=0; /* Log actions */
+-struct termio cons, stbuf, svbuf; /* termios: svbuf=before, stbuf=while */
++struct termios cons, stbuf, svbuf; /* termios: svbuf=before, stbuf=while */
+ int comfd=0; /* Communication file descriptor. Defaults to stdin. */
+ char msg[STRINGL]; /* Massage messages here */
+ int preturn,returns[MAXGOSUBS];
+@@ -175,7 +175,7 @@
+
+ /* Exit after resetting terminal settings */
+ void ext(long xtc) {
+- ioctl(1, TCSETA, &cons);
++ tcsetattr(1, TCSANOW, &cons);
+ exit(xtc);
+ }
+
+@@ -923,24 +923,24 @@
+ void setcom(void) {
+ stbuf.c_cflag &= ~(CBAUD | CSIZE | CSTOPB | CLOCAL | PARENB);
+ stbuf.c_cflag |= (speed | bits | CREAD | clocal | parity | stopbits );
+- if (ioctl(comfd, TCSETA, &stbuf) < 0) {
++ if (tcsetattr(comfd, TCSANOW, &stbuf) < 0) {
+ serror("Can't ioctl set device",1);
+ }
+ }
+
+ void doset(void) {
+- struct termio console;
++ struct termios console;
+ int a,b;
+ gettoken();
+ if(strcmp(token,"echo")==0) {
+ a=0;
+ if(getonoroff()) a=ECHO|ECHOE;
+- if(ioctl(0, TCGETA, &console)<0) {
++ if(tcgetattr(0, &console)<0) {
+ serror("Can't ioctl FD zero!\n",2);
+ }
+ console.c_lflag &= ~(ECHO | ECHOE);
+ console.c_lflag |= a;
+- ioctl(0, TCSETA, &console);
++ tcsetattr(0, TCSANOW, &console);
+ }
+ else if(strcmp(token,"senddelay")==0) {
+ senddelay=10000L*getdvalue();
+@@ -1227,7 +1227,7 @@
+ if(strcmp(token,"hardcom")==0) {
+ if(comfd== -1) serror("Com device not open",1);
+ vmsg("Closing device");
+- if (ioctl(comfd, TCSETA, &svbuf) < 0) {
++ if (tcsetattr(comfd, TCSANOW, &svbuf) < 0) {
+ sprintf(msg,"Can't ioctl set device %s.\n",device);
+ serror(msg,1);
+ }
+@@ -1265,16 +1265,16 @@
+ else {
+ if ((comfd = open(device, O_RDWR|O_EXCL|O_NONBLOCK|O_NOCTTY)) <0) { //O_NONBLOCK|O_NOCTTY)) <0) {//
+ sprintf(msg,"Can't open device %s.\n",device);
+- printf(msg);
++ printf("%s", msg);
+ ext(1);
+ }
+ }
+- if (ioctl (comfd, TCGETA, &svbuf) < 0) {
++ if (tcgetattr(comfd, &svbuf) < 0) {
+ sprintf(msg,"Can't control %s, please try again.\n",device);
+ serror(msg,1);
+ }
+ setenv("COMGTDEVICE",device,1);
+- ioctl(comfd, TCGETA, &stbuf);
++ tcgetattr(comfd, &stbuf);
+ speed=stbuf.c_cflag & CBAUD;
+ if (high_speed == 0) strcpy(cspeed,"115200");
+ else strcpy(cspeed,"57600");
+@@ -1300,17 +1300,17 @@
+ if(strcmp(device,"-")!=0) {
+ if ((comfd = open(device, O_RDWR|O_EXCL|O_NONBLOCK|O_NOCTTY)) <0) { //O_NONBLOCK|O_NOCTTY)) <0) {//
+ sprintf(msg,"Can't open device %s.\n",device);
+- printf(msg);
++ printf("%s", msg);
+ ext(1);
+ }
+ }
+ else comfd=0;
+
+- if (ioctl (comfd, TCGETA, &svbuf) < 0) {
++ if (tcgetattr(comfd, &svbuf) < 0) {
+ sprintf(msg,"Can't ioctl get device %s.\n",device);
+ serror(msg,1);
+ }
+- ioctl(comfd, TCGETA, &stbuf);
++ tcgetattr(comfd, &stbuf);
+ speed=stbuf.c_cflag & CBAUD;
+ switch(speed) {
+ case B0: strcpy(cspeed,"0");break;
+@@ -1556,7 +1556,7 @@
+ skip_default=0;
+ filep=NULL;
+ scriptspace=4096;
+- ioctl(1, TCGETA, &cons);
++ tcgetattr(1, &cons);
+ if((script=( char *)malloc(scriptspace))==NULL) {
+ serror("Could not malloc()",3);
+ }
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/comgt.git/commitdiff/f6698866b524756785111aa9b1ed80820e5286b7
More information about the pld-cvs-commit
mailing list