comparison mercurial/cext/parsers.c @ 48279:249d1888e9d8

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
author Raphaël Gomès <rgomes@octobus.net>
date Wed, 20 Oct 2021 18:05:16 +0200
parents bb240915f69f
children 126feb805247
comparison
equal deleted inserted replaced
48278:fd3d4b7f8e62 48279:249d1888e9d8
258 258
259 static PyObject *dirstate_item_v2_data(dirstateItemObject *self) 259 static PyObject *dirstate_item_v2_data(dirstateItemObject *self)
260 { 260 {
261 int flags = self->flags; 261 int flags = self->flags;
262 int mode = dirstate_item_c_v1_mode(self); 262 int mode = dirstate_item_c_v1_mode(self);
263 #ifdef S_IXUSR
264 /* This is for platforms with an exec bit */
263 if ((mode & S_IXUSR) != 0) { 265 if ((mode & S_IXUSR) != 0) {
264 flags |= dirstate_flag_mode_exec_perm; 266 flags |= dirstate_flag_mode_exec_perm;
265 } else { 267 } else {
266 flags &= ~dirstate_flag_mode_exec_perm; 268 flags &= ~dirstate_flag_mode_exec_perm;
267 } 269 }
270 #else
271 flags &= ~dirstate_flag_mode_exec_perm;
272 #endif
268 if (S_ISLNK(mode)) { 273 if (S_ISLNK(mode)) {
269 flags |= dirstate_flag_mode_is_symlink; 274 flags |= dirstate_flag_mode_is_symlink;
270 } else { 275 } else {
271 flags &= ~dirstate_flag_mode_is_symlink; 276 flags &= ~dirstate_flag_mode_is_symlink;
272 } 277 }