summaryrefslogtreecommitdiff
path: root/src/filelock.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/filelock.c')
-rw-r--r--src/filelock.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/filelock.c b/src/filelock.c
index b28f16e9b5a..73202f0b2c4 100644
--- a/src/filelock.c
+++ b/src/filelock.c
@@ -347,7 +347,8 @@ rename_lock_file (char const *old, char const *new, bool force)
potential race condition since some other process may create
NEW immediately after the existence check, but it's the best
we can portably do here. */
- if (lstat (new, &st) == 0 || errno == EOVERFLOW)
+ if (emacs_fstatat (AT_FDCWD, new, &st, AT_SYMLINK_NOFOLLOW) == 0
+ || errno == EOVERFLOW)
{
errno = EEXIST;
return -1;