This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]