[RFA/commit] Handle EOF on terminals opened with ENONBLOCK...

Joel Brobecker brobecker@adacore.com
Thu Apr 23 20:37:00 GMT 2009


> I suppose the errno == EAGAIN is supposed to check whether fgetc()
> failed.  However, your code has an ferror() in between, which could
> clobber errno.  So perhaps it is better to reverse those checks.

I did it in that order because I wanted to test the error condition
on the FILE before actually checking errno. The C99 draft that I have
does not say anything about errno, but the man page on my GNU/Linux
machine does say explicitly that errno doesn't get set during
a call to ferror.

I can try reversing them, though... Let me know if you think I should.

-- 
Joel



More information about the Gdb-patches mailing list