parsers: don't ask about the exec bit on platforms that don't have it
authorRaphaël Gomès <rgomes@octobus.net>
Wed, 20 Oct 2021 18:05:16 +0200
changeset 48279 249d1888e9d8
parent 48278 fd3d4b7f8e62
child 48280 126feb805247
parsers: don't ask about the exec bit on platforms that don't have it Otherwise the compiler gets quite sad. Differential Revision: https://phab.mercurial-scm.org/D11711
mercurial/cext/parsers.c
--- a/mercurial/cext/parsers.c	Tue Oct 19 18:06:07 2021 -0700
+++ b/mercurial/cext/parsers.c	Wed Oct 20 18:05:16 2021 +0200
@@ -260,11 +260,16 @@
 {
 	int flags = self->flags;
 	int mode = dirstate_item_c_v1_mode(self);
+#ifdef S_IXUSR
+	/* This is for platforms with an exec bit */
 	if ((mode & S_IXUSR) != 0) {
 		flags |= dirstate_flag_mode_exec_perm;
 	} else {
 		flags &= ~dirstate_flag_mode_exec_perm;
 	}
+#else
+	flags &= ~dirstate_flag_mode_exec_perm;
+#endif
 	if (S_ISLNK(mode)) {
 		flags |= dirstate_flag_mode_is_symlink;
 	} else {