12 @@ -81,7 +81,7 @@ char token[MAXTOKEN]; /* For gettoken(
13 char scriptfile[MAXPATH]; /* Script file name */
14 char scriptfilepath[MAXPATH]; /* temp storage for full path */
15 BOOL verbose=0; /* Log actions */
16 -struct termio cons, stbuf, svbuf; /* termios: svbuf=before, stbuf=while */
17 +struct termios cons, stbuf, svbuf; /* termios: svbuf=before, stbuf=while */
18 int comfd=0; /* Communication file descriptor. Defaults to stdin. */
19 char msg[STRINGL]; /* Massage messages here */
20 int preturn,returns[MAXGOSUBS];
21 @@ -172,7 +172,7 @@ void dotestkey(void) {
23 /* Exit after resetting terminal settings */
25 - ioctl(1, TCSETA, &cons);
26 + ioctl(1, TCSETS, &cons);
30 @@ -920,24 +920,24 @@ BOOL getonoroff(void) {
32 stbuf.c_cflag &= ~(CBAUD | CSIZE | CSTOPB | CLOCAL | PARENB);
33 stbuf.c_cflag |= (speed | bits | CREAD | clocal | parity | stopbits );
34 - if (ioctl(comfd, TCSETA, &stbuf) < 0) {
35 + if (ioctl(comfd, TCSETS, &stbuf) < 0) {
36 serror("Can't ioctl set device",1);
41 - struct termio console;
42 + struct termios console;
45 if(strcmp(token,"echo")==0) {
47 if(getonoroff()) a=ECHO|ECHOE;
48 - if(ioctl(0, TCGETA, &console)<0) {
49 + if(ioctl(0, TCGETS, &console)<0) {
50 serror("Can't ioctl FD zero!\n",2);
52 console.c_lflag &= ~(ECHO | ECHOE);
54 - ioctl(0, TCSETA, &console);
55 + ioctl(0, TCSETS, &console);
57 else if(strcmp(token,"senddelay")==0) {
58 senddelay=10000L*getdvalue();
59 @@ -1224,7 +1224,7 @@ void doclose(void) {
60 if(strcmp(token,"hardcom")==0) {
61 if(comfd== -1) serror("Com device not open",1);
62 vmsg("Closing device");
63 - if (ioctl(comfd, TCSETA, &svbuf) < 0) {
64 + if (ioctl(comfd, TCSETS, &svbuf) < 0) {
65 sprintf(msg,"Can't ioctl set device %s.\n",device);
68 @@ -1266,12 +1266,12 @@ void opengt(void) {
72 - if (ioctl (comfd, TCGETA, &svbuf) < 0) {
73 + if (ioctl (comfd, TCGETS, &svbuf) < 0) {
74 sprintf(msg,"Can't control %s, please try again.\n",device);
77 setenv("COMGTDEVICE",device,1);
78 - ioctl(comfd, TCGETA, &stbuf);
79 + ioctl(comfd, TCGETS, &stbuf);
80 speed=stbuf.c_cflag & CBAUD;
81 if (high_speed == 0) strcpy(cspeed,"115200");
82 else strcpy(cspeed,"57600");
83 @@ -1303,11 +1303,11 @@ void opendevice(void) {
87 - if (ioctl (comfd, TCGETA, &svbuf) < 0) {
88 + if (ioctl (comfd, TCGETS, &svbuf) < 0) {
89 sprintf(msg,"Can't ioctl get device %s.\n",device);
92 - ioctl(comfd, TCGETA, &stbuf);
93 + ioctl(comfd, TCGETS, &stbuf);
94 speed=stbuf.c_cflag & CBAUD;
96 case B0: strcpy(cspeed,"0");break;
97 @@ -1553,7 +1553,7 @@ int main(int argc,char **argv) {
101 - ioctl(1, TCGETA, &cons);
102 + ioctl(1, TCGETS, &cons);
103 if((script=( char *)malloc(scriptspace))==NULL) {
104 serror("Could not malloc()",3);