summaryrefslogtreecommitdiff
path: root/src/filelock.c
diff options
context:
space:
mode:
authorNickolas Lloyd <ultrageek.lloyd@gmail.com>2017-02-01 22:31:55 -0500
committerNickolas Lloyd <ultrageek.lloyd@gmail.com>2017-02-01 22:31:55 -0500
commit9a15b5509abb49a11c97c1101ad216f4ef258368 (patch)
tree7311337d92833cb8f233eaa696a967a15a306a80 /src/filelock.c
parent5d8f2548ceaa5a0b33c08a39f1d6c11071ec63aa (diff)
parent70d36dda26465b43c1a63e8e13153e070af86456 (diff)
downloademacs-nick.lloyd-bytecode-jit.tar.gz
Merge branch 'master' into nick.lloyd-bytecode-jitnick.lloyd-bytecode-jit
Diffstat (limited to 'src/filelock.c')
-rw-r--r--src/filelock.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/filelock.c b/src/filelock.c
index de65c52efa1..67e8dbd34ed 100644
--- a/src/filelock.c
+++ b/src/filelock.c
@@ -407,9 +407,7 @@ create_lock_file (char *lfname, char *lock_info_str, bool force)
fcntl (fd, F_SETFD, FD_CLOEXEC);
lock_info_len = strlen (lock_info_str);
err = 0;
- /* Use 'write', not 'emacs_write', as garbage collection
- might signal an error, which would leak FD. */
- if (write (fd, lock_info_str, lock_info_len) != lock_info_len
+ if (emacs_write (fd, lock_info_str, lock_info_len) != lock_info_len
|| fchmod (fd, S_IRUSR | S_IRGRP | S_IROTH) != 0)
err = errno;
/* There is no need to call fsync here, as the contents of
@@ -490,8 +488,7 @@ read_lock_data (char *lfname, char lfinfo[MAX_LFINFO + 1])
int fd = emacs_open (lfname, O_RDONLY | O_NOFOLLOW, 0);
if (0 <= fd)
{
- /* Use read, not emacs_read, since FD isn't unwind-protected. */
- ptrdiff_t read_bytes = read (fd, lfinfo, MAX_LFINFO + 1);
+ ptrdiff_t read_bytes = emacs_read (fd, lfinfo, MAX_LFINFO + 1);
int read_errno = errno;
if (emacs_close (fd) != 0)
return -1;