Volume XXII, number 279Tuesday, October 6, 2026Latest message 1 hour ago

The Git List

News and archive of git@vger.kernel.org, since April 2005

patchRe: [PATCH] exec_cmd: RUNTIME_PREFIX on OpenBSD systems

3 messages between Sep 21, 2026 and Sep 22, 2026, from Chris Torek, Johannes Sixt.

Plain Markdown or JSON for tools and agents. Diffs are folded; open one to read it.

Chris TorekSep 21, 2026, 13:00 UTC on lore
[Ugh, somehow plain text mode got turned off, re-sending]
On Wed, Sep 16, 2026 at 8:41 PM Brad Smith <brad@comstyle.com> wrote:
Show 14 quoted lines
>
> @@ -209,6 +229,10 @@ static int git_get_exec_path(struct strbuf *buf, const char *argv0)
>          * after the first successful method.
>          */
>         if (
> +#ifdef HAVE_GETEXECPATH
> +               git_get_exec_path_getexecpath(buf) &&
> +#endif /* HAVE_GETEXECPATH */
> +
>  #ifdef HAVE_BSD_KERN_PROC_SYSCTL
>                 git_get_exec_path_bsd_sysctl(buf) &&
>  #endif /* HAVE_BSD_KERN_PROC_SYSCTL */
> --
> 2.55.0

Sort of a minor nit, but given this code construct, there should probably be instructions saying to define only one of these.

Chris
Johannes SixtSep 21, 2026, 16:43 UTC in reply to Chris Torek on lore
Am 21.09.26 um 15:00 schrieb Chris Torek:
Show 20 quoted lines
> [Ugh, somehow plain text mode got turned off, re-sending]
> 
> On Wed, Sep 16, 2026 at 8:41 PM Brad Smith <brad@comstyle.com> wrote:
>>
>> @@ -209,6 +229,10 @@ static int git_get_exec_path(struct strbuf *buf, const char *argv0)
>>          * after the first successful method.
>>          */
>>         if (
>> +#ifdef HAVE_GETEXECPATH
>> +               git_get_exec_path_getexecpath(buf) &&
>> +#endif /* HAVE_GETEXECPATH */
>> +
>>  #ifdef HAVE_BSD_KERN_PROC_SYSCTL
>>                 git_get_exec_path_bsd_sysctl(buf) &&
>>  #endif /* HAVE_BSD_KERN_PROC_SYSCTL */
>> --
>> 2.55.0
> 
> Sort of a minor nit, but given this code construct, there should probably be
> instructions saying to define only one of these.

This caught me too. But notice that the calls are chained by && so that the first successful call determines the outcome.

-- Hannes
Chris TorekSep 22, 2026, 01:17 UTC in reply to Johannes Sixt on lore

On Mon, Sep 21, 2026 at 9:43 AM Johannes Sixt <j6t@kdbg.org> wrote: [re the multiple get exec path call sequence]

> This caught me too. But notice that the calls are chained by && so that
> the first successful call determines the outcome.

I noticed the &&'s but I somehow thought that successful return was nonzero instead of zero.

(It didn't help when gmail went a little wonky on me, either, hence the accidental rejected HTML email)

Chris

Back to recent threads

Re: [PATCH] exec_cmd: RUNTIME_PREFIX on OpenBSD systems | The Git List