diff options
| author | Eli Zaretskii | 2012-10-12 17:19:54 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2012-10-12 17:19:54 +0200 |
| commit | bb385a92ec4f8f5bbc93641aaa274bd735826574 (patch) | |
| tree | 8fff4a185dfc74f91d94edc7b45dcd9dacbfbd67 /src/w32.c | |
| parent | 605a3df6811c2b3ce9379149cc8fd64fc9846136 (diff) | |
| download | emacs-bb385a92ec4f8f5bbc93641aaa274bd735826574.tar.gz emacs-bb385a92ec4f8f5bbc93641aaa274bd735826574.zip | |
Fix bug #12587 with slow startup on MS-Windows with Netlogon service.
src/fileio.c (check_existing): New function.
(make_temp_name, Ffile_exists_p, Ffile_writable_p): Call it
instead of calling 'stat', when what's needed is to check whether
a file exists. This avoids expensive system calls on MS-Windows.
src/w32.c (init_environment): Call 'check_existing' instead of 'stat'.
src/lread.c (openp) [WINDOWSNT]: Call 'access' instead of 'stat' to
determine whether a file exists and is not a directory.
src/lisp.h (check_existing): Add prototype.
Diffstat (limited to 'src/w32.c')
| -rw-r--r-- | src/w32.c | 3 |
1 files changed, 1 insertions, 2 deletions
| @@ -1612,7 +1612,6 @@ init_environment (char ** argv) | |||
| 1612 | LPBYTE lpval; | 1612 | LPBYTE lpval; |
| 1613 | DWORD dwType; | 1613 | DWORD dwType; |
| 1614 | char locale_name[32]; | 1614 | char locale_name[32]; |
| 1615 | struct stat ignored; | ||
| 1616 | char default_home[MAX_PATH]; | 1615 | char default_home[MAX_PATH]; |
| 1617 | int appdata = 0; | 1616 | int appdata = 0; |
| 1618 | 1617 | ||
| @@ -1653,7 +1652,7 @@ init_environment (char ** argv) | |||
| 1653 | /* For backwards compatibility, check if a .emacs file exists in C:/ | 1652 | /* For backwards compatibility, check if a .emacs file exists in C:/ |
| 1654 | If not, then we can try to default to the appdata directory under the | 1653 | If not, then we can try to default to the appdata directory under the |
| 1655 | user's profile, which is more likely to be writable. */ | 1654 | user's profile, which is more likely to be writable. */ |
| 1656 | if (stat ("C:/.emacs", &ignored) < 0) | 1655 | if (check_existing ("C:/.emacs")) |
| 1657 | { | 1656 | { |
| 1658 | HRESULT profile_result; | 1657 | HRESULT profile_result; |
| 1659 | /* Dynamically load ShGetFolderPath, as it won't exist on versions | 1658 | /* Dynamically load ShGetFolderPath, as it won't exist on versions |