git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Erik Faye-Lund <kusmabite@googlemail.com>
To: Ilari Liusvaara <ilari.liusvaara@elisanet.fi>
Cc: git@vger.kernel.org
Subject: Re: [Updated PATCH 1/2] Report exec errors from run-command
Date: Wed, 30 Dec 2009 14:47:11 +0100	[thread overview]
Message-ID: <40aa078e0912300547r407efb74xb821345a54a87277@mail.gmail.com> (raw)
In-Reply-To: <1262170338-11574-2-git-send-email-ilari.liusvaara@elisanet.fi>

On Wed, Dec 30, 2009 at 11:52 AM, Ilari Liusvaara
<ilari.liusvaara@elisanet.fi> wrote:
> +static inline void force_close(int fd)
> +{
> +       while (close(fd) < 0 && errno != EBADF)
> +               ; /* No-op */
> +}
> +

According to http://linux.die.net/man/2/close, close can set errno to
EBADF, EINTR, or EIO. Currently, you're retrying on EINTR and EIO.
When we get EIO, are you sure it makes sense to retry? I'd imagine
that error would most likely just repeat itself, leading to an
infinite loop. How about "while (close(fd) < 0 && errno == EINTR)"
instead? I've seen other functions (like xread in wrapper.c) only
retry on those errors that it expects. In xreads case, it's not
retrying on EIO.

Perhaps it's OK still, since force_close() is only used on pipes. I
don't know if closing a pipe can generate EIO or not.

-- 
Erik "kusma" Faye-Lund

  reply	other threads:[~2009-12-30 13:47 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-30 10:52 [Updated PATCH 0/2] Improve remote helpers exec error reporting Ilari Liusvaara
2009-12-30 10:52 ` [Updated PATCH 1/2] Report exec errors from run-command Ilari Liusvaara
2009-12-30 13:47   ` Erik Faye-Lund [this message]
2009-12-31  5:26   ` Tarmigan
2009-12-31 10:48     ` Ilari Liusvaara
2009-12-31 14:44       ` Tarmigan
2009-12-30 10:52 ` [Updated PATCH 2/2] Improve transport helper exec failure reporting Ilari Liusvaara
2009-12-31 15:44   ` Johannes Sixt
2009-12-31 16:59     ` Ilari Liusvaara
2009-12-31 17:48       ` Johannes Sixt
2009-12-31 18:24         ` Ilari Liusvaara
2009-12-31 18:44           ` Johannes Sixt
2010-01-01  0:34             ` Johannes Sixt

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=40aa078e0912300547r407efb74xb821345a54a87277@mail.gmail.com \
    --to=kusmabite@googlemail.com \
    --cc=git@vger.kernel.org \
    --cc=ilari.liusvaara@elisanet.fi \
    --cc=kusmabite@gmail.com \
    /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;
as well as URLs for NNTP newsgroup(s).