diff options
| author | Paul Eggert | 2011-07-04 10:50:12 -0700 |
|---|---|---|
| committer | Paul Eggert | 2011-07-04 10:50:12 -0700 |
| commit | 6e9b2be9e608802dfe46a34638aabeb99a701d8c (patch) | |
| tree | 5b5c0907cda5d39fd1983a017d4fca6eb97264f0 /src | |
| parent | c8af70e11e5429b216974e46f687d9e9f98efbcd (diff) | |
| download | emacs-6e9b2be9e608802dfe46a34638aabeb99a701d8c.tar.gz emacs-6e9b2be9e608802dfe46a34638aabeb99a701d8c.zip | |
* 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')
| -rw-r--r-- | src/ChangeLog | 5 | ||||
| -rw-r--r-- | src/fileio.c | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 70f6fb7469f..8e208565bde 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2011-07-04 Paul Eggert <eggert@cs.ucla.edu> | ||
| 2 | |||
| 3 | * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR. | ||
| 4 | This is more efficient than Ffile_directory_p and avoids a minor race. | ||
| 5 | |||
| 1 | 2011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org> | 6 | 2011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org> |
| 2 | 7 | ||
| 3 | * buffer.c (Foverlay_put): Say what the return value is | 8 | * 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, | |||
| 1755 | regardless of what access permissions it has. */ | 1755 | regardless of what access permissions it has. */ |
| 1756 | if (lstat (SSDATA (encoded_filename), &statbuf) >= 0) | 1756 | if (lstat (SSDATA (encoded_filename), &statbuf) >= 0) |
| 1757 | { | 1757 | { |
| 1758 | if (Ffile_directory_p (absname)) | 1758 | if (S_ISDIR (statbuf.st_mode)) |
| 1759 | xsignal2 (Qfile_error, | 1759 | xsignal2 (Qfile_error, |
| 1760 | build_string ("File is a directory"), absname); | 1760 | build_string ("File is a directory"), absname); |
| 1761 | 1761 | ||