From 530ac51f5b83b4ad189d55047f149e4bc0750f20 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Mon, 7 Mar 2022 18:03:14 +0100 Subject: [PATCH] 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). --- src/filelock.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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) -- 2.39.2