All of lore.kernel.org
 help / color / mirror / Atom feed
From: Denis Kenzior <denkenz@gmail.com>
To: ofono@ofono.org
Subject: Re: [PATCH] When setting the serial port, the previous settings need to be preserved.
Date: Tue, 20 Oct 2009 10:13:52 -0500	[thread overview]
Message-ID: <200910201013.52644.denkenz@gmail.com> (raw)
In-Reply-To: <4ADD7E7E.8030903@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 697 bytes --]

Hi Ryan,

> Sorry. I have had a long few days. The last patch was just COMPLETELY
> wrong :(
>
> I think i got it right this time...

So the patch is still wrong :)

 	memset(&ti, 0, sizeof(ti));
 	cfmakeraw(&ti);
 
+	fd = open(tty, O_RDWR | O_NOCTTY | O_NONBLOCK);
+	if (fd < 0)
+		return -1;
+
+	tcgetattr(fd,&ti);
+

You're blowing away the result of cfmakeraw.  Most of the devices are not true 
serial devices and so do not need any of the special options.  Passing a NULL 
options GHashTable should result in cfmakeraw.  Why don't you just pass all 
the options you need instead of using tcgetattr?

The other parts of the patch look good to me.

Regards,
-Denis

  reply	other threads:[~2009-10-20 15:13 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-19 14:28 [PATCH] When setting the serial port, the previous settings need to be preserved Ryan Raasch
2009-10-19 17:32 ` Denis Kenzior
2009-10-20  7:43   ` Ryan Raasch
2009-10-20  9:10     ` Ryan Raasch
2009-10-20 15:13       ` Denis Kenzior [this message]
2009-10-20 15:51         ` Ryan Raasch
2009-10-20 15:36           ` Denis Kenzior
2009-10-21  8:43             ` Ryan Raasch
2009-10-22  0:09               ` Denis Kenzior
  -- strict thread matches above, loose matches on Subject: below --
2009-10-19 17:18 Ryan Raasch
2009-10-19 17:21 ` Ryan Raasch

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200910201013.52644.denkenz@gmail.com \
    --to=denkenz@gmail.com \
    --cc=ofono@ofono.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.