aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2019-09-18 15:14:15 +0300
committerEli Zaretskii2019-09-18 15:14:15 +0300
commit7ff2eef926f933c79c3913c18f9403a4a987756b (patch)
tree35dd24590511a1e0efc5b54af21a0d9187be0058 /src
parent735940f4551a43f3b4381105dc074cd7d494f2f3 (diff)
downloademacs-7ff2eef926f933c79c3913c18f9403a4a987756b.tar.gz
emacs-7ff2eef926f933c79c3913c18f9403a4a987756b.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/fileio.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/fileio.c b/src/fileio.c
index 58bc6b7ee8c..53eecc31aaf 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -2961,7 +2961,10 @@ file_directory_p (Lisp_Object file)
2961{ 2961{
2962#ifdef DOS_NT 2962#ifdef DOS_NT
2963 /* This is cheaper than 'stat'. */ 2963 /* This is cheaper than 'stat'. */
2964 return faccessat (AT_FDCWD, SSDATA (file), D_OK, AT_EACCESS) == 0; 2964 bool retval = faccessat (AT_FDCWD, SSDATA (file), D_OK, AT_EACCESS) == 0;
2965 if (!retval && errno == EACCES)
2966 errno = ENOTDIR; /* like the non-DOS_NT branch below does */
2967 return retval;
2965#else 2968#else
2966# ifdef O_PATH 2969# ifdef O_PATH
2967 /* Use O_PATH if available, as it avoids races and EOVERFLOW issues. */ 2970 /* Use O_PATH if available, as it avoids races and EOVERFLOW issues. */