From: Eli Zaretskii Date: Sat, 17 Nov 2012 16:52:48 +0000 (+0200) Subject: Fix MS-Windows emulation of 'faccessat' wrt directories. X-Git-Tag: emacs-24.3.90~173^2~18^2~80 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=6ad30855c02908fdd99d9b11943719e185e65ee3;p=emacs.git Fix MS-Windows emulation of 'faccessat' wrt directories. src/w32.c (faccessat): Pretend that directories have the execute bit set. Emacs expects that, e.g., in files.el:cd-absolute. --- diff --git a/src/ChangeLog b/src/ChangeLog index 45d48ba41cc..df8bf602afe 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,8 @@ 2012-11-17 Eli Zaretskii + * w32.c (faccessat): Pretend that directories have the execute bit + set. Emacs expects that, e.g., in files.el:cd-absolute. + * w32proc.c (create_child): Don't clip the PID of the child process to fit into an Emacs integer, as this is no longer a restriction. diff --git a/src/w32.c b/src/w32.c index eb07e13a2fb..46433626802 100644 --- a/src/w32.c +++ b/src/w32.c @@ -2762,7 +2762,8 @@ faccessat (int dirfd, const char * path, int mode, int flags) } return -1; } - if ((mode & X_OK) != 0 && !is_exec (path)) + if ((mode & X_OK) != 0 + && !(is_exec (path) || (attributes & FILE_ATTRIBUTE_DIRECTORY) != 0)) { errno = EACCES; return -1;