From: Paul Eggert Date: Fri, 27 Jan 2017 16:56:34 +0000 (-0800) Subject: Slightly tune file-accessible-directory-p fix X-Git-Tag: emacs-26.0.90~870^2~13 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=412b8dac5277092e677b3cd57b0fd1a36893a26b;p=emacs.git Slightly tune file-accessible-directory-p fix * src/fileio.c (Ffile_accessible_directory_p): Remove unnecessary test (Bug#25419). --- diff --git a/src/fileio.c b/src/fileio.c index 8e549a44855..b8706e1e893 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -2816,13 +2816,15 @@ really is a readable and searchable directory. */) { Lisp_Object r = call2 (handler, Qfile_accessible_directory_p, absname); - /* This might be a lie (e.g., the directory might not exist, or - be a regular file), but at least it does TRT in the "usual" - case of an existing directory that is not accessible by the - current user, and avoids reporting "Success" for a failed - operation. */ - if (!EQ (r, Qt)) - errno = EACCES; + /* Set errno in case the handler failed. EACCES might be a lie + (e.g., the directory might not exist, or be a regular file), + but at least it does TRT in the "usual" case of an existing + directory that is not accessible by the current user, and + avoids reporting "Success" for a failed operation. Perhaps + someday we can fix this in a better way, by improving + file-accessible-directory-p's API; see Bug#25419. */ + errno = EACCES; + return r; }