After updating some old Freebsd V6 systems to V8 Stable the programm tip does not work in hayes mode anymore. Same behaviour with tip from HEAD. The reason are the lines /* XXX preserve previous braindamaged behavior */ setboolean(value(DC), TRUE); in tip.c, these lines should be deleted, because a line like testcall:dv=/dev/cuau1:br#38400:pa=none:at=hayes:pn=1234567:du: in /etc/remote can't be used with "tip testcall". Further I propose the following patch for hayes.c. The patch allows tip to diconnect a modem connection clean and let compile hayes.c with DEBUG enabled. Be aware that tip does not check returncodes on his read and write systemcalls. --- hayes.c.1st 2013-01-14 15:23:47.000000000 +0100 +++ hayes.c 2014-09-07 23:32:47.000000000 +0200 @@ -146,10 +146,15 @@ void hay_disconnect(void) { + struct termios cntrl; + /* first hang up the modem*/ #ifdef DEBUG printf("\rdisconnecting modem....\n\r"); #endif + tcgetattr(FD, &cntrl); + cntrl.c_cflag |= CLOCAL; + tcsetattr(FD, TCSAFLUSH, &cntrl); ioctl(FD, TIOCCDTR, 0); sleep(1); ioctl(FD, TIOCSDTR, 0); @@ -195,7 +200,7 @@ alarm(0); c &= 0177; #ifdef DEBUG - printf("%c 0x%x ", c, c); + printf("%c 0x%x\n", c, c); #endif for (i = 0; i < strlen(match); i++) if (c == match[i]) @@ -252,7 +257,11 @@ goodbye(void) { int len; +#ifdef DEBUG + int rlen; +#else char c; +#endif tcflush(FD, TCIOFLUSH); if (hay_sync()) {
Created attachment 193878 [details] Improved patch for tip against FreeBSD 10 or newer.