Subject: bug#71477: 30.0.50; Lock files are not deleted on Windows 98

From: Eli Zaretskii <[email-masked]>
Date: Tue, 11 Jun 2024 09:47:26 +0300

> From: Po Lu <[email-masked]>
> Cc: [email-masked]
> Date: Tue, 11 Jun 2024 09:41:54 +0800
> 
> Eli Zaretskii <[email-masked]> writes:
> 
> > I don't have access to Windows 9X anymore, and there's no such
> > directory on the Windows system to which I do have access.  So either
> > you or someone will show a recipe that can be reproduced and debugged
> > on a more modern system, or you dig into the EINVAL on that system and
> > tell more details to understand what happens, or we just dismiss this
> > bug alone with "moreinfo" tag (after all, this is just a warning).
> 
> I think I've arrived at the problem: Femacs_pid and getpid return a
> negative value, and once it is duly written to the lock file,
> current_lock_owner does not accept the sign character after the PID
> separator, consequently returning EINVAL.  Apparently, in times past
> file-locking routines cast all PIDs to unsigned long, but that behavior
> was lost in the midst of changes since installed for Unix systems, and
> as such I will attempt to restore the historical semantics on Windows
> systems.

Sorry, I don't understand the problems with negative PID values.
Where exactly in the code of filelock.c it gets in the way?

We had a similar problem on Cygwin, albeit with boot time, not PID,
and we fixed it very easily.  If filelock.c assumes PIDs are positive
somewhere, please point out that code.  In any case, please don't
install any changes in this area without posting them for discussion
first.

Thanks.