From: Junio C Hamano <gitster@pobox.com>
To: "Haritha via GitGitGadget" <gitgitgadget@gmail.com>
Cc: git@vger.kernel.org, Haritha <harithamma.d@ibm.com>
Subject: Re: [PATCH] exec_cmd: RUNTIME_PREFIX on z/OS systems
Date: Fri, 23 Aug 2024 09:57:46 -0700 [thread overview]
Message-ID: <xmqqa5h3p46t.fsf@gitster.g> (raw)
In-Reply-To: <xmqqplq0tur4.fsf@gitster.g> (Junio C. Hamano's message of "Thu, 22 Aug 2024 08:58:07 -0700")
Junio C Hamano <gitster@pobox.com> writes:
> The following shows how I would fix what I found annoying while
> studying the existing code to prepare this review. None of it
> should be part of this topic (even though it could become a
> preliminary clean-up step if we wanted to), but since I wrote it
> already, I'll record it here on the list as #leftoverbits.
>
> Thanks.
I'll take your patch as-is and merge it down to 'next'.
Once the dust settles from this topic, I'll see if we want to do
further clean-ups (the "how-about" patch below, possibly also
reorder them alphabetically) so for now, I'd leave #leftoverbits
mark here.
> Makefile | 26 ++++++++++++++------------
> exec-cmd.c | 20 +++++++++-----------
> 2 files changed, 23 insertions(+), 23 deletions(-)
>
> diff --git c/Makefile w/Makefile
> index 41dfa0bad2..910aec0973 100644
> --- c/Makefile
> +++ w/Makefile
> @@ -373,21 +373,23 @@ include shared.mak
> # Perl scripts to use a modified entry point header allowing them to resolve
> # support files at runtime.
> #
> -# When using RUNTIME_PREFIX, define HAVE_BSD_KERN_PROC_SYSCTL if your platform
> -# supports the KERN_PROC BSD sysctl function.
> +# When using RUNTIME_PREFIX:
> #
> -# When using RUNTIME_PREFIX, define PROCFS_EXECUTABLE_PATH if your platform
> -# mounts a "procfs" filesystem capable of resolving the path of the current
> -# executable. If defined, this must be the canonical path for the "procfs"
> -# current executable path.
> +# - define HAVE_BSD_KERN_PROC_SYSCTL if your platform supports the
> +# KERN_PROC BSD sysctl function.
> #
> -# When using RUNTIME_PREFIX, define HAVE_NS_GET_EXECUTABLE_PATH if your platform
> -# supports calling _NSGetExecutablePath to retrieve the path of the running
> -# executable.
> +# - define PROCFS_EXECUTABLE_PATH if your platform mounts a "procfs"
> +# filesystem capable of resolving the path of the current
> +# executable. If defined, this must be the canonical path for the
> +# "procfs" current executable path.
> #
> -# When using RUNTIME_PREFIX, define HAVE_WPGMPTR if your platform offers
> -# the global variable _wpgmptr containing the absolute path of the current
> -# executable (this is the case on Windows).
> +# - define HAVE_NS_GET_EXECUTABLE_PATH if your platform supports
> +# calling _NSGetExecutablePath to retrieve the path of the running
> +# executable.
> +#
> +# - define HAVE_WPGMPTR if your platform offers the global variable
> +# _wpgmptr containing the absolute path of the current executable
> +# (this is the case on Windows).
> #
> # INSTALL_STRIP can be set to "-s" to strip binaries during installation,
> # if your $(INSTALL) command supports the option.
> diff --git c/exec-cmd.c w/exec-cmd.c
> index 909777f61f..54bc7ed304 100644
> --- c/exec-cmd.c
> +++ w/exec-cmd.c
> @@ -100,6 +100,8 @@ static int git_get_exec_path_procfs(struct strbuf *buf)
> }
> return -1;
> }
> +#else
> +# define git_get_exec_path_procfs(ignore) 1
> #endif /* PROCFS_EXECUTABLE_PATH */
>
> #ifdef HAVE_BSD_KERN_PROC_SYSCTL
> @@ -127,6 +129,8 @@ static int git_get_exec_path_bsd_sysctl(struct strbuf *buf)
> }
> return -1;
> }
> +#else
> +# define git_get_exec_path_bsd_sysctl(ignore) 1
> #endif /* HAVE_BSD_KERN_PROC_SYSCTL */
>
> #ifdef HAVE_NS_GET_EXECUTABLE_PATH
> @@ -148,6 +152,8 @@ static int git_get_exec_path_darwin(struct strbuf *buf)
> }
> return -1;
> }
> +#else
> +# define git_get_exec_path_darwin(ignore) 1
> #endif /* HAVE_NS_GET_EXECUTABLE_PATH */
>
> #ifdef HAVE_WPGMPTR
> @@ -166,6 +172,8 @@ static int git_get_exec_path_wpgmptr(struct strbuf *buf)
> buf->len += len;
> return 0;
> }
> +#else
> +# define git_get_exec_path_wpgmptr(ignore) 1
> #endif /* HAVE_WPGMPTR */
>
> /*
> @@ -190,22 +198,12 @@ static int git_get_exec_path(struct strbuf *buf, const char *argv0)
> * after the first successful method.
> */
> if (
> -#ifdef HAVE_BSD_KERN_PROC_SYSCTL
> git_get_exec_path_bsd_sysctl(buf) &&
> -#endif /* HAVE_BSD_KERN_PROC_SYSCTL */
> -
> -#ifdef HAVE_NS_GET_EXECUTABLE_PATH
> git_get_exec_path_darwin(buf) &&
> -#endif /* HAVE_NS_GET_EXECUTABLE_PATH */
> -
> -#ifdef PROCFS_EXECUTABLE_PATH
> git_get_exec_path_procfs(buf) &&
> -#endif /* PROCFS_EXECUTABLE_PATH */
> -
> -#ifdef HAVE_WPGMPTR
> git_get_exec_path_wpgmptr(buf) &&
> -#endif /* HAVE_WPGMPTR */
>
> + /* fallback -- must be at the end */
> git_get_exec_path_from_argv0(buf, argv0)) {
> return -1;
> }
next prev parent reply other threads:[~2024-08-23 16:57 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-22 13:52 [PATCH] exec_cmd: RUNTIME_PREFIX on z/OS systems Haritha via GitGitGadget
2024-08-22 15:58 ` Junio C Hamano
2024-08-23 16:57 ` Junio C Hamano [this message]
2024-08-27 6:18 ` Haritha D
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=xmqqa5h3p46t.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=gitgitgadget@gmail.com \
--cc=harithamma.d@ibm.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 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.