summaryrefslogtreecommitdiff
path: root/src/fileio.c
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2011-07-04 10:50:12 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2011-07-04 10:50:12 -0700
commit6e9b2be9e608802dfe46a34638aabeb99a701d8c (patch)
tree5b5c0907cda5d39fd1983a017d4fca6eb97264f0 /src/fileio.c
parentc8af70e11e5429b216974e46f687d9e9f98efbcd (diff)
downloademacs-6e9b2be9e608802dfe46a34638aabeb99a701d8c.tar.gz
* fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
This is more efficient than Ffile_directory_p and avoids a minor race.
Diffstat (limited to 'src/fileio.c')
-rw-r--r--src/fileio.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/fileio.c b/src/fileio.c
index 68834d5b5ec..c6f8dfe4683 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -1755,7 +1755,7 @@ barf_or_query_if_file_exists (Lisp_Object absname, const char *querystring,
regardless of what access permissions it has. */
if (lstat (SSDATA (encoded_filename), &statbuf) >= 0)
{
- if (Ffile_directory_p (absname))
+ if (S_ISDIR (statbuf.st_mode))
xsignal2 (Qfile_error,
build_string ("File is a directory"), absname);