Re: [PATCH 3/5] run-command: Elaborate execvp error checking
- From
Frans Klaver <fransklaver@gmail.com>
- Date
- Jan 25, 2012, 22:59 UTC
- Message-ID
- <op.v8nwsnyv0aolir@keputer.lokaal>
- In-Reply-To
- <4F205212.5080007@kdbg.org>
On Wed, 25 Jan 2012 20:03:46 +0100, Johannes Sixt <j6t@kdbg.org> wrote:
Show 17 quoted lines
> Am 24.01.2012 23:32, schrieb Frans Klaver:
>> +static void inspect_failure(const char *argv0, int silent_exec_failure)
>> +{
>> + int err = errno;
>> + struct strbuf sb = STRBUF_INIT;
>> +
>> + /* errors not related to path */
>> + if (errno == E2BIG || errno == ENOMEM)
>> + die_file_error(argv0, err);
>> +
>> + if (strchr(argv0, '/')) {
>> + if (file_exists(argv0)) {
>> + strbuf_add(&sb, argv0, strlen(argv0));
>> + inspect_file(&sb, err, argv0);
>
> Can we end up here if errno == ENOENT? If so, silent_exec_failure must
> be checked. (inspect_file does not return.)Hm, good catch. Yes, we can if the interpreter isn't found. I never intended to actually leave the "interpreter not found" ENOENT case in it's current shape, so it probably slipped through. Will fix inspect_failure here to guarantee silent_exec_failure is heeded. Patch 5/5 would probably remove it again.
Thanks.