summaryrefslogtreecommitdiff
path: root/src/filelock.c
diff options
context:
space:
mode:
authorLars Ingebrigtsen <larsi@gnus.org>2022-03-07 18:03:14 +0100
committerLars Ingebrigtsen <larsi@gnus.org>2022-03-07 18:03:14 +0100
commit530ac51f5b83b4ad189d55047f149e4bc0750f20 (patch)
tree42226a5e029901d778c4ddcbb7fc09744790fe21 /src/filelock.c
parent324d8938c783e9f09f989dbb19d092eaca7a99b8 (diff)
downloademacs-530ac51f5b83b4ad189d55047f149e4bc0750f20.tar.gz
Remove lock file in --no-build-details, too
* src/filelock.c (current_lock_owner): Make file writes work when using --no-build-details (bug#54294).
Diffstat (limited to 'src/filelock.c')
-rw-r--r--src/filelock.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/filelock.c b/src/filelock.c
index cb548ac79bd..4fdad8d8560 100644
--- a/src/filelock.c
+++ b/src/filelock.c
@@ -578,8 +578,13 @@ current_lock_owner (lock_info_type *owner, char *lfname)
if (lfinfo_end != owner->user + lfinfolen)
return EINVAL;
- /* On current host? */
Lisp_Object system_name = Fsystem_name ();
+ /* If `system-name' returns nil, that means we're in a
+ --no-build-details Emacs, and the name part of the link (e.g.,
+ .#test.txt -> larsi@.118961:1646577954) is an empty string. */
+ if (NILP (system_name))
+ system_name = build_string ("");
+ /* On current host? */
if (STRINGP (system_name)
&& dot - (at + 1) == SBYTES (system_name)
&& memcmp (at + 1, SSDATA (system_name), SBYTES (system_name)) == 0)