Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Date: Thu, 8 Sep 2005 23:01:36 -0400 From: Christopher Faylor To: cygwin AT cygwin DOT com Subject: Re: Please try a snapshot - stty issue Message-ID: <20050909030136.GC18908@trixie.casa.cgf.cx> Reply-To: cygwin AT cygwin DOT com References: <9ED26B1C-5449-42D3-B498-454134FFF08F AT rehley DOT 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/