git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] portability: allow building in systems without d_type
@ 2025-06-18  6:23 Carlo Marcelo Arenas Belón
  2025-06-18  6:39 ` Collin Funk
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Carlo Marcelo Arenas Belón @ 2025-06-18  6:23 UTC (permalink / raw)
  To: git; +Cc: Jacob Keller, Carlo Marcelo Arenas Belón

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;
 		}
 
-- 
2.50.0.53.g63c9ac04f7


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2025-06-18 19:32 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).