[PATCH] When setting the serial port, the previous settings need to be preserved.

Denis Kenzior denkenz at gmail.com
Tue Oct 20 08:13:52 PDT 2009


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


More information about the ofono mailing list