git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ilari Liusvaara <ilari.liusvaara@elisanet.fi>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: Re: [RFC PATCH 1/2] Report exec errors from run-command
Date: Fri, 25 Dec 2009 11:51:48 +0200	[thread overview]
Message-ID: <20091225095147.GB8319@Knoppix> (raw)
In-Reply-To: <7vr5qjecbb.fsf@alter.siamese.dyndns.org>

On Thu, Dec 24, 2009 at 11:35:04PM -0800, Junio C Hamano wrote:
> Ilari Liusvaara <ilari.liusvaara@elisanet.fi> writes:
> 
> Thanks; I think overall this is a good idea, even though I have no clue
> if WIN32 side wants a similar support.

It would. But I have no clue about WIN32. But there are other people
on this list who have. :-)
 
>  - At first reading, the "while (close(fd) < 0 && errno != EBADF);"
>    pattern was a bit of eyesore.  It might be worth factoring that out to
>    a small static helper function that a smart compiler would
>    automatically inline (or mark it as a static inline).

Done (with bit of reformatting to add space, line break and comment.

>  - Is it guaranteed that a failed pipe(2) never touches its int fildes[2]
>    parameter, or the values are undefined when it fails?  The approach
>    would save one extra variable, compared to an alternative approach to
>    keep an explicit variable to record a pipe failure, but It feels iffy
>    that the code relies on them being left as their initial -1 values.

I added explicit set to -1 on failure case (I think failed pipe doesn't touch
those, but you never know about what some oddball OS is going to do).

>  - Should we worry about partial write as well (you seem to warn when you
>    get a partial read)?  Is it worth using xread() and friends found in
>    wrapper.c instead of goto read/write_again?

That's hairy code. One really can't print any errors in write path, as those
errors would go to who knows where due to redirections (I took the error
warning out).

That partial read warning is more for detecting 'can't happen' situations
since pipe should be large enough to atomically transfer integer.

>  - Shouldn't any of these warning() be die() instead?

If error reporting failures are fatal, all of them.

-Ilari

  parent reply	other threads:[~2009-12-25  9:52 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-24 17:49 [RFC PATCH 0/2] Report remote helper exec failures Ilari Liusvaara
2009-12-24 17:49 ` [RFC PATCH 1/2] Report exec errors from run-command Ilari Liusvaara
2009-12-25  7:35   ` Junio C Hamano
2009-12-25  7:46     ` Junio C Hamano
2009-12-25  8:40     ` Junio C Hamano
2009-12-25  9:51     ` Ilari Liusvaara [this message]
2009-12-25 14:39   ` Johannes Sixt
2009-12-25 17:15     ` Ilari Liusvaara
2009-12-24 17:49 ` [RFC PATCH 2/2] Improve transport helper exec failure reporting Ilari Liusvaara
2009-12-25  7:44   ` Junio C Hamano
2009-12-25  9:32     ` Ilari Liusvaara

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=20091225095147.GB8319@Knoppix \
    --to=ilari.liusvaara@elisanet.fi \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.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).