From: Paul Eggert Date: Mon, 4 Jul 2011 17:50:12 +0000 (-0700) Subject: * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR. X-Git-Tag: emacs-pretest-24.0.90~104^2~152^2~190 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=6e9b2be9e608802dfe46a34638aabeb99a701d8c;p=emacs.git * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR. This is more efficient than Ffile_directory_p and avoids a minor race. --- diff --git a/src/ChangeLog b/src/ChangeLog index 70f6fb7469f..8e208565bde 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2011-07-04 Paul Eggert + + * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR. + This is more efficient than Ffile_directory_p and avoids a minor race. + 2011-07-04 Lars Magne Ingebrigtsen * buffer.c (Foverlay_put): Say what the return value is 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);