From: Johannes Sixt <j6t@kdbg.org>
To: Ilari Liusvaara <ilari.liusvaara@elisanet.fi>
Cc: git@vger.kernel.org
Subject: Re: [Updated PATCH 2/2] Improve transport helper exec failure reporting
Date: Thu, 31 Dec 2009 19:44:40 +0100 [thread overview]
Message-ID: <4B3CF118.7080404@kdbg.org> (raw)
In-Reply-To: <20091231182436.GA1326@Knoppix>
Ilari Liusvaara schrieb:
> On Thu, Dec 31, 2009 at 06:48:02PM +0100, Johannes Sixt wrote:
>> In case 3, it is expected that the child process prints a suitable
>> error message. Therefore, you should start with merely replacing the
>> unconditional
>>
>> exit(127);
>> by
>> if (errno == ENOENT)
>> exit(127);
>> else
>> die_errno("Cannot exec %s", cmd->argv[0]);
>>
>> And then you can think about how you support the ENOENT case better.
>> My proposal for this was to do the PATH lookup manually before the
>> fork(), and then the above conditional would melt down to simply:
>>
>> die_errno("Cannot exec %s", cmd->argv[0]);
>>
>
> The child process can't sanely print anything. Stderr would go to
> who knows where.
Wrong - because:
> Parent process should have much better idea what to
> do with errors.
Very correct. For this reason, the parent process assigns a stderr channel
to the child (or does not do so to inherit its own stderr), and the child
is expected to use it. Errors due to execvp failures are no exception, IMO
(except ENOENT, as always).
-- Hannes
next prev parent reply other threads:[~2009-12-31 18:44 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
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 [this message]
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=4B3CF118.7080404@kdbg.org \
--to=j6t@kdbg.org \
--cc=git@vger.kernel.org \
--cc=ilari.liusvaara@elisanet.fi \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.