Problems while using divecomputer-simulator for linux

Jef Driesen jef at libdivecomputer.org
Mon Mar 31 01:24:53 PDT 2014


On 2014-03-30 21:52, Linus Torvalds wrote:
> On Sun, Mar 30, 2014 at 12:14 PM, Venkatesh Shukla IIT BHU
> <venkatesh.shukla.eee11 at iitbhu.ac.in> wrote:
>> 
>> I have done as you asked. The output is here : 
>> http://pastebin.com/E50ayiSs
>> 
>> I have recently shifted to Fedora 20. It worked in Ubuntu earlier.
> 
> It does indeed look like some glibc idiocy. Sometimes I wonder what
> the f*ck is wrong with libc people.
> 
> The kernel didn't actually complain at all, and what seems to happen
> is that glibc tries to be "helpful", and after it has done the TCSETC
> it does a TCGETC and compares the result.

I'm also doing this check in libdivecomputer. This is even mentioned in 
the tcsetattr man pages:

"Note  that  tcsetattr() returns success if any of the requested changes
could be successfully carried out.   Therefore,  when  making  multiple
changes  it may be necessary to follow this call with a further call to
tcgetattr() to check that all changes have been performed successfully."

Because libdivecomputer makes multiple changes to the termios structure, 
I just followed this advice...

I simply don't know this stuff well enough, especially at the time when 
I wrote that code, to judge whether this kind of check is 
needed/stupid/whatever.

Jef


More information about the devel mailing list