This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA/commit] Handle EOF on terminals opened with ENONBLOCK...
> 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