summaryrefslogtreecommitdiff
path: root/src/filelock.c
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2013-05-04 17:51:49 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2013-05-04 17:51:49 -0700
commitcbee2131718baa6389713bb551bcfd5c72b39035 (patch)
tree2f28d12ed0cac14194f0e9a56376b19ccad3c2b5 /src/filelock.c
parentfd3a9a6b378e556c3b09b217920d95cb129a13d6 (diff)
downloademacs-cbee2131718baa6389713bb551bcfd5c72b39035.tar.gz
`write-region-inhibit-fsync' defaults to noninteractive.
* cmdargs.texi (Initial Options): * files.texi (Customize Save): Document this. * etc/NEWS: Document this. * src/fileio.c (syms_of_fileio): Implement this. * src/filelock.c (create_lock_file): If symbolic links don't work, so we use a regular file as a lock file, do not fsync the lock file; it's not needed. Fixes: debbugs:14273
Diffstat (limited to 'src/filelock.c')
-rw-r--r--src/filelock.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/filelock.c b/src/filelock.c
index f17d3182eab..de6aba8385c 100644
--- a/src/filelock.c
+++ b/src/filelock.c
@@ -437,14 +437,8 @@ create_lock_file (char *lfname, char *lock_info_str, bool force)
if (emacs_write (fd, lock_info_str, lock_info_len) != lock_info_len
|| (need_fchmod && fchmod (fd, world_readable) != 0))
err = errno;
- else
- while (fsync (fd) != 0)
- if (errno != EINTR)
- {
- if (errno != EINVAL)
- err = errno;
- break;
- }
+ /* There is no need to call fsync here, as the contents of
+ the lock file need not survive system crashes. */
if (emacs_close (fd) != 0)
err = errno;
if (!err && rename_lock_file (nonce, lfname, force) != 0)