unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Ken Brown <kbrown@cornell.edu>
To: Eli Zaretskii <eliz@gnu.org>
Cc: yamaoka@jpl.org, 70415@debbugs.gnu.org
Subject: bug#70415: 30.0.50; [Cygwin] `lock-file' creates a symlink with funny name
Date: Wed, 1 May 2024 17:20:20 -0400	[thread overview]
Message-ID: <26ab8055-1da6-4b3e-a65c-68c598cb7660@cornell.edu> (raw)
In-Reply-To: <86le4uq0tj.fsf@gnu.org>

On 4/30/2024 12:20 PM, Eli Zaretskii wrote:
>> Date: Tue, 30 Apr 2024 11:23:21 -0400
>> Cc: yamaoka@jpl.org, 70415@debbugs.gnu.org
>> From: Ken Brown <kbrown@cornell.edu>
>>
>> On 4/29/2024 10:34 PM, Eli Zaretskii wrote:
>>>> Date: Mon, 29 Apr 2024 19:05:35 -0400
>>>> From: Ken Brown <kbrown@cornell.edu>
>>>> Cc: 70415@debbugs.gnu.org
>>>>
>>>> I finally had a chance to look at this, and I can't reproduce the
>>>> problem.  The autosave file does not have the ":BOOT_TIME" part, and it
>>>> gets deleted properly when the file is saved.  I'm running the latest
>>>> stable release of Cygwin (3.5.3) on Windows 11 (version 23H2, build
>>>> 22631.3447).
>>>
>>> This is not about autosave files, this is about lock files.  Those are
>>> created once you modify a file-visiting buffer.
>>
>> Sorry, I didn't write what I meant.  I meant to refer to the lock file.
> 
> OK.  So it sounds like on some Cygwin systems this call in filelock.c:
> 
>    static int
>    lock_file_1 (Lisp_Object lfname, bool force)
>    {
>      intmax_t boot = get_boot_sec ();
> 
> yields a non-zero (and negative!) value of 'boot', and on other Cygwin
> systems it yields zero.  Because that's how Emacs decides whether to
> append that ":-NNNN" part:
> 
>      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

Ken





  reply	other threads:[~2024-05-01 21:20 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-16 12:33 bug#70415: 30.0.50; [Cygwin] `lock-file' creates a symlink with funny name Katsumi Yamaoka
2024-04-16 13:32 ` Eli Zaretskii
2024-04-16 18:01   ` Pierre Téchoueyres
2024-04-16 22:57   ` Ken Brown
2024-04-17 12:08     ` Eli Zaretskii
2024-04-16 23:58   ` Katsumi Yamaoka
2024-04-17 12:21     ` Eli Zaretskii
2024-04-22 16:15       ` Ken Brown
2024-04-29 23:05         ` Ken Brown
2024-04-30  2:34           ` Eli Zaretskii
2024-04-30  6:45             ` Katsumi Yamaoka
2024-04-30 15:23             ` Ken Brown
2024-04-30 16:20               ` Eli Zaretskii
2024-05-01 21:20                 ` Ken Brown [this message]
2024-05-02  6:21                   ` Eli Zaretskii
2024-05-02 14:26                     ` Ken Brown
2024-05-04 17:15                       ` Ken Brown
2024-05-04 17:25                         ` Eli Zaretskii
2024-05-04 17:46                           ` Ken Brown
2024-05-04 22:01                             ` Ken Brown
2024-05-05  5:40                               ` Eli Zaretskii
2024-05-05 16:21                                 ` Ken Brown
2024-05-05 16:32                                   ` Eli Zaretskii
2024-05-05 17:02                                     ` Ken Brown
2024-05-05 18:00                                       ` Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-07  0:07                                       ` Katsumi Yamaoka
2024-05-04 17:30                         ` Ken Brown
2024-05-04 17:37                           ` Eli Zaretskii
2024-05-04 18:46                             ` Ken Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=26ab8055-1da6-4b3e-a65c-68c598cb7660@cornell.edu \
    --to=kbrown@cornell.edu \
    --cc=70415@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=yamaoka@jpl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).