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

From: Paul Eggert <[email-masked]>
Date: Wed, 12 Jun 2024 10:57:10 -0700

On 2024-06-12 10:10, Eli Zaretskii wrote:

> But on all platforms except Windows 9X we shouldn't see a negative PID
> here, so what you say is purely theoretical, no?

No, because that value doesn't come from a pid_t that the system gave us 
as a process ID. It comes from the file system, and so could be invalid 
as a process ID. That's why the code already checks that pid <= 
TYPE_MAXIMUM (pid_t). Such a check wouldn't be needed if the pid were a 
valid process ID.

>> Even on MS Windows 98 we should check that TYPE_MINIMUM (pid_t) <= pid.
> 
> Since pid_t is typedefed as 'int', that's always true, no?

No, because the code is checking 'pid', which is of type intmax_t not 
pid_t. (And anyway pid_t need not be 'int'.)

> No.  And our emulation of 'kill' fails with EPERM when called witgh
> both arguments zero.

In that case there's no need to worry about pid == 0 here.

> Fine with me, please install and I will followup.

OK, installed.