Util-Linux package development
 help / color / mirror / Atom feed
From: Ruediger Meier <sweet_f_a@gmx.de>
To: Karel Zak <kzak@redhat.com>
Cc: util-linux@vger.kernel.org
Subject: Re: [PATCH] script: evaluate errno only if read() sets it
Date: Fri, 3 Jul 2015 12:33:47 +0200	[thread overview]
Message-ID: <201507031233.47481.sweet_f_a@gmx.de> (raw)
In-Reply-To: <20150703080426.GH26962@ws.net.home>

On Friday 03 July 2015, Karel Zak wrote:
> On Thu, Jul 02, 2015 at 12:21:02PM +0200, Ruediger Meier wrote:
> > I have a question and a comment about my own patch :)
> >
>  :-)
>
> I have applied the patch with some small changes:
> > On Thursday 02 July 2015, Ruediger Meier wrote:
> > > @@ -367,7 +365,7 @@ static void handle_signal(struct
> > > script_control *ctl, int fd)
> > >
> > >  	bytes = read(fd, &info, sizeof(info));
> > >  	if (bytes != sizeof(info)) {
> > > -		if (errno == EAGAIN)
> > > +		if (bytes < 0 && errno == EAGAIN)
> > >  			return;
> >
> > Should we also return on EINTR here like we do in handle_io()?
>
> It's probably more robust, Fixed.

BTW there is another potential issue for systems where EAGAIN != 
EWOULDBLOCK. These systems might be seldom but who knows exactly? If we 
don't want to care about EWOULDBLOCK in whole util-linux then we 
should maybe abort configure if both are not equal ... and wait for 
complaining users.

see
http://stackoverflow.com/questions/7003234/which-systems-define-eagain-and-ewouldblock-as-different-values

I've tested on AIX but when using gcc and/or the right defines I've
got EAGAIN == EWOULDBLOCK there too.

cu,
Rudi

  reply	other threads:[~2015-07-03 10:33 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-02  0:03 script, broken test options/return Ruediger Meier
2015-07-02  8:23 ` Karel Zak
2015-07-02  8:32 ` Karel Zak
2015-07-02 10:06   ` Ruediger Meier
2015-07-02 10:10     ` [PATCH] script: evaluate errno only if read() sets it Ruediger Meier
2015-07-02 10:21       ` Ruediger Meier
2015-07-03  8:04         ` Karel Zak
2015-07-03 10:33           ` Ruediger Meier [this message]
2016-02-12 16:23     ` [PATCH] tests: mkfs.ext3 image-file needs option -F Ruediger Meier
2016-02-12 16:25       ` Ruediger Meier

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=201507031233.47481.sweet_f_a@gmx.de \
    --to=sweet_f_a@gmx.de \
    --cc=kzak@redhat.com \
    --cc=util-linux@vger.kernel.org \
    /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