Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 10 Sep 2014 15:50:27 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-bugs@FreeBSD.org
Subject:   [Bug 193525] New: Let tip work in hayes mode again
Message-ID:  <bug-193525-8@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=193525

            Bug ID: 193525
           Summary: Let tip work in hayes mode again
           Product: Base System
           Version: 8.4-STABLE
          Hardware: Any
                OS: Any
            Status: Needs Triage
          Severity: Affects Some People
          Priority: ---
         Component: bin
          Assignee: freebsd-bugs@FreeBSD.org
          Reporter: longwitz@incore.de

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()) {

-- 
You are receiving this mail because:
You are the assignee for the bug.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-193525-8>