Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Date: Thu, 8 Sep 2005 23:01:36 -0400
From: Christopher Faylor <cgf-no-personal-reply-please@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: Please try a snapshot - stty issue
Message-ID: <20050909030136.GC18908@trixie.casa.cgf.cx>
Reply-To: cygwin@cygwin.com
References: <9ED26B1C-5449-42D3-B498-454134FFF08F@rehley.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <9ED26B1C-5449-42D3-B498-454134FFF08F@rehley.net>
User-Agent: Mutt/1.5.8i

On Thu, Sep 08, 2005 at 06:47:07PM -0700, Peter Rehley wrote:
>Hi,
>
>I tried stty on snapshot 20050908 and I still get an error message:
>
>stty -F /dev/ttyS0 9600 ; # Different baud then current baud.
>stty: /dev/ttyS0: unable to perform all requested operations.
>
>If I issue the same command a second time I get no error message.
>
>I've traced the problem to /usr/include/sys/termios.h in the  
>cfsetispeek and cfsetospeed macros.  These set c_ispeed and c_ospeed  
>values to set the baud rate, but the baud rate is also stored in  
>c_cflag, and that value is not being set by these macros.  It gets  
>set when tcgetattr is called.
>
>When stty does a compare to see if the change was successfull it sees  
>the original c_cflag and compares to the changed c_cflag and finds  
>that they are different and issues the error message.... actually it  
>does a simply memory compare, but these c_cflag values are different.
>
>One fix would be to change the macros so that they set the baud rate  
>i  c_cflag...of course stty (coreutils) would need to be recompiled  
>for that changed to be picked up.

Since Cygwin always uses the c_ospeed value when setting the baud,
whatever shows up in c_cflag is meaningless.  So, I've just refrained
from setting the CBAUD part of this field.  I don't know if this will
break something else but it seems to work with stty.

While I was at it, I got 'stty -F /dev/ttyS0 -a' working, too.

These changes will be in the next snapshot.

Thanks for tracking this down.

cgf

cgf

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

