]> git.eshelyaron.com Git - emacs.git/commitdiff
Slightly tune file-accessible-directory-p fix
authorPaul Eggert <eggert@cs.ucla.edu>
Fri, 27 Jan 2017 16:56:34 +0000 (08:56 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Fri, 27 Jan 2017 16:58:02 +0000 (08:58 -0800)
* src/fileio.c (Ffile_accessible_directory_p):
Remove unnecessary test (Bug#25419).

src/fileio.c

index 8e549a448550cfdc708cc5b7b7d104e51c43a2ab..b8706e1e8934ee03051b3c1a2be7691b83164bb2 100644 (file)
@@ -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;
     }