Subject: bug#70415: 30.0.50; [Cygwin] `lock-file' creates a symlink with funny name

From: Ken Brown <[email-masked]>
Date: Thu, 2 May 2024 10:26:31 -0400

On 5/2/2024 2:21 AM, Eli Zaretskii wrote:
>> Date: Wed, 1 May 2024 17:20:20 -0400
>> Cc: [email-masked], [email-masked]
>> From: Ken Brown <[email-masked]>
>>
>>>       char const *lock_info_fmt = (boot
>>> 				 ? "%s@%s.%"PRIdMAX":%"PRIdMAX
>>> 				 : "%s@%s.%"PRIdMAX);
>>>       int len = snprintf (lock_info_str, sizeof lock_info_str,
>>> 			lock_info_fmt, user_name, host_name, pid, boot);
>>>
>>> get_boot_sec calls get_boot_time, which is a Gnulib function (see
>>> lib/boot-time.c).  So I guess the key to unlock this puzzle is
>>> somewhere there.
>>
>> I took a quick look at get_boot_time and found a bug, which may explain
>> why some Cygwin systems behave differently from others.  I've reported
>> it here:
>>
>>     https://lists.gnu.org/archive/html/bug-gnulib/2024-05/msg00008.html
> 
> Thanks.  This probably explains why the ":-NNNN" part sometimes
> appears and sometimes doesn't appear in Cygwin builds of Emacs, but
> AFAIU it does NOT explain why unlinking the symlink (when the file is
> unlocked) fails when the lock file name includes the ":-NNNN" part.
> Right?

Yes, that's right.  I still need to look into that.

Ken