emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 7ff2eef 1/2: Fix the MS-Windows build broken by rec


From: Eli Zaretskii
Subject: [Emacs-diffs] master 7ff2eef 1/2: Fix the MS-Windows build broken by recent errno changes
Date: Wed, 18 Sep 2019 08:15:37 -0400 (EDT)

branch: master
commit 7ff2eef926f933c79c3913c18f9403a4a987756b
Author: Eli Zaretskii <address@hidden>
Commit: Eli Zaretskii <address@hidden>

    Fix the MS-Windows build broken by recent errno changes
    
    * src/fileio.c (file_directory_p): If the file exists, but is
    not a directory, set errno to ENOTDIR, like the Posix branch
    does; openp expects that.
---
 src/fileio.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/fileio.c b/src/fileio.c
index 58bc6b7..53eecc3 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -2961,7 +2961,10 @@ file_directory_p (Lisp_Object file)
 {
 #ifdef DOS_NT
   /* This is cheaper than 'stat'.  */
-  return faccessat (AT_FDCWD, SSDATA (file), D_OK, AT_EACCESS) == 0;
+  bool retval = faccessat (AT_FDCWD, SSDATA (file), D_OK, AT_EACCESS) == 0;
+  if (!retval && errno == EACCES)
+    errno = ENOTDIR;   /* like the non-DOS_NT branch below does */
+  return retval;
 #else
 # ifdef O_PATH
   /* Use O_PATH if available, as it avoids races and EOVERFLOW issues.  */



reply via email to

[Prev in Thread] Current Thread [Next in Thread]