Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@adacore.com>
To: Mark Kettenis <mark.kettenis@xs4all.nl>
Cc: gdb-patches@sourceware.org
Subject: Re: [RFA/commit] Handle EOF on terminals opened with ENONBLOCK...
Date: Thu, 23 Apr 2009 20:37:00 -0000	[thread overview]
Message-ID: <20090423203710.GH7552@adacore.com> (raw)
In-Reply-To: <200904231934.n3NJY7j7006691@brahms.sibelius.xs4all.nl>

> 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


  reply	other threads:[~2009-04-23 20:37 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-23 19:14 Joel Brobecker
2009-04-23 19:35 ` Mark Kettenis
2009-04-23 20:37   ` Joel Brobecker [this message]
2009-04-23 20:45     ` Mark Kettenis
2009-04-24 10:20 ` Eli Zaretskii
2009-05-06 23:02 ` Joel Brobecker
2009-05-07  3:13   ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090423203710.GH7552@adacore.com \
    --to=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    --cc=mark.kettenis@xs4all.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox