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.
This commit is contained in:
parent
735940f455
commit
7ff2eef926
1 changed files with 4 additions and 1 deletions
|
@ -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. */
|
||||
|
|
Loading…
Add table
Reference in a new issue