]> git.eshelyaron.com Git - emacs.git/commitdiff
Remove lock file in --no-build-details, too
authorLars Ingebrigtsen <larsi@gnus.org>
Mon, 7 Mar 2022 17:03:14 +0000 (18:03 +0100)
committerLars Ingebrigtsen <larsi@gnus.org>
Mon, 7 Mar 2022 17:03:14 +0000 (18:03 +0100)
* src/filelock.c (current_lock_owner): Make file writes work when
using --no-build-details (bug#54294).

src/filelock.c

index cb548ac79bd1d2fd823cf793ddfe69270571bef5..4fdad8d8560a659b357197e3641c75fdeab16dac 100644 (file)
@@ -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)