From: Collin Funk <collin.funk1@gmail•com>
To: "Carlo Marcelo Arenas Belón" <carenas@gmail•com>
Cc: git@vger•kernel.org, Jacob Keller <jacob.keller@gmail•com>
Subject: Re: [PATCH] portability: allow building in systems without d_type
Date: Tue, 17 Jun 2025 23:39:08 -0700 [thread overview]
Message-ID: <87zfe5h7ub.fsf@gmail.com> (raw)
In-Reply-To: <20250618062331.78059-1-carenas@gmail.com>
Hi Carlo,
Carlo Marcelo Arenas Belón <carenas@gmail•com> writes:
> Since 09fb155f11 (diff --no-index: support limiting by pathspec,
> 2025-05-21) will fail to build in platforms that don't have a
> d_type member on their struct dirent (ex: AIX, NonStop).
>
> Use the DTYPE() macro instead of a nake reference to d_type.
>
> Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail•com>
> ---
> diff-no-index.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/diff-no-index.c b/diff-no-index.c
> index 4aeeb98cfa..7c95222ba6 100644
> --- a/diff-no-index.c
> +++ b/diff-no-index.c
> @@ -46,7 +46,7 @@ static int read_directory_contents(const char *path, struct string_list *list,
>
> if (!match_leading_pathspec(NULL, pathspec,
> match.buf, match.len,
> - 0, NULL, e->d_type == DT_DIR ? 1 : 0))
> + 0, NULL, DTYPE(e) == DT_DIR ? 1 : 0))
> continue;
> }
I confirm that before this patch the build will fail with the following
on AIX 7.3:
CC diff-no-index.o
diff-no-index.c: In function 'read_directory_contents':
diff-no-index.c:49:21: error: 'struct dirent' has no member named 'd_type'
49 | 0, NULL, e->d_type == DT_DIR ? 1 : 0))
| ^~
gmake: *** [Makefile:2821: diff-no-index.o] Error 1
This patch fixes it. Thanks.
Reviewed-by: Collin Funk <collin.funk1@gmail•com>
Collin
next prev parent reply other threads:[~2025-06-18 6:39 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-18 6:23 [PATCH] portability: allow building in systems without d_type Carlo Marcelo Arenas Belón
2025-06-18 6:39 ` Collin Funk [this message]
2025-06-18 14:12 ` Marc Branchaud
2025-06-18 14:32 ` Kristoffer Haugsbakk
2025-06-18 18:20 ` Junio C Hamano
2025-06-18 19:32 ` Collin Funk
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=87zfe5h7ub.fsf@gmail.com \
--to=collin.funk1@gmail$(echo .)com \
--cc=carenas@gmail$(echo .)com \
--cc=git@vger$(echo .)kernel.org \
--cc=jacob.keller@gmail$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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