diff options
| author | Paul Eggert | 2017-08-12 14:00:17 -0700 |
|---|---|---|
| committer | Paul Eggert | 2017-08-12 15:14:45 -0700 |
| commit | a6ad98ad66e1d0c0dac5f25ba91e11d0cf9da725 (patch) | |
| tree | 183748df6a5b71f1b48deecc824eef27939ff2f8 /admin | |
| parent | 9eb30cb03613ae158c870d603a05a6a6393dc485 (diff) | |
| download | emacs-a6ad98ad66e1d0c0dac5f25ba91e11d0cf9da725.tar.gz emacs-a6ad98ad66e1d0c0dac5f25ba91e11d0cf9da725.zip | |
Improve make-temp-file performance on local files
For the motivation behind this patch, please see Bug#28023 and:
http://emacshorrors.com/posts/make-temp-name.html
Although, given the recent changes to Tramp, the related security
problem in make-temp-file is already fixed, make-temp-file still has
several unnecessary system calls. In the typical case on GNU/Linux,
this patch replaces 8 syscalls (symlink, open, close, readlinkat, uname,
getpid, unlink, umask) by 2 (open, close).
* admin/merge-gnulib (GNULIB_MODULES): Add tempname, now
that Emacs is using it directly.
* configure.ac (AUTO_DEPEND): Remove AC_SYS_LONG_FILE_NAMES;
no longer needed.
* lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
* lisp/files.el (files--make-magic-temp-file): Rename from
make-temp-file.
(make-temp-file): Use make-temp-file-internal for
non-magic file names.
* src/fileio.c: Include tempname.h.
(make_temp_name_tbl, make_temp_name_count)
(make_temp_name_count_initialized_p, make_temp_name): Remove.
(Fmake_temp_file_internal): New function.
(Fmake_temp_name): Use it.
* src/filelock.c (get_boot_time): Use Fmake_temp_file_internal
instead of make_temp_name.
Diffstat (limited to 'admin')
| -rw-r--r-- | admin/CPP-DEFINES | 1 | ||||
| -rwxr-xr-x | admin/merge-gnulib | 4 |
2 files changed, 2 insertions, 3 deletions
diff --git a/admin/CPP-DEFINES b/admin/CPP-DEFINES index cead305aee1..10b558d1ada 100644 --- a/admin/CPP-DEFINES +++ b/admin/CPP-DEFINES | |||
| @@ -205,7 +205,6 @@ HAVE_LIBXML2 | |||
| 205 | HAVE_LIBXMU | 205 | HAVE_LIBXMU |
| 206 | HAVE_LOCALTIME_R | 206 | HAVE_LOCALTIME_R |
| 207 | HAVE_LOCAL_SOCKETS | 207 | HAVE_LOCAL_SOCKETS |
| 208 | HAVE_LONG_FILE_NAMES | ||
| 209 | HAVE_LONG_LONG_INT | 208 | HAVE_LONG_LONG_INT |
| 210 | HAVE_LRAND48 | 209 | HAVE_LRAND48 |
| 211 | HAVE_LSTAT | 210 | HAVE_LSTAT |
diff --git a/admin/merge-gnulib b/admin/merge-gnulib index a16d7fa53ea..7eca64305de 100755 --- a/admin/merge-gnulib +++ b/admin/merge-gnulib | |||
| @@ -39,8 +39,8 @@ GNULIB_MODULES=' | |||
| 39 | manywarnings memrchr minmax mkostemp mktime nstrftime | 39 | manywarnings memrchr minmax mkostemp mktime nstrftime |
| 40 | pipe2 pselect pthread_sigmask putenv qcopy-acl readlink readlinkat | 40 | pipe2 pselect pthread_sigmask putenv qcopy-acl readlink readlinkat |
| 41 | sig2str socklen stat-time std-gnu11 stdalign stddef stdio | 41 | sig2str socklen stat-time std-gnu11 stdalign stddef stdio |
| 42 | stpcpy strtoimax symlink sys_stat | 42 | stpcpy strtoimax symlink sys_stat sys_time |
| 43 | sys_time time time_r time_rz timegm timer-time timespec-add timespec-sub | 43 | tempname time time_r time_rz timegm timer-time timespec-add timespec-sub |
| 44 | update-copyright unlocked-io utimens | 44 | update-copyright unlocked-io utimens |
| 45 | vla warnings | 45 | vla warnings |
| 46 | ' | 46 | ' |