Re: FW: Win32 fix for miscinit.c - Mailing list pgsql-patches

From Magnus Hagander
Subject Re: FW: Win32 fix for miscinit.c
Date
Msg-id 6BCB9D8A16AC4241919521715F4D8BCE475E03@algol.sollentuna.se
Whole thread Raw
In response to FW: Win32 fix for miscinit.c  ("Dave Page" <dpage@vale-housing.co.uk>)
List pgsql-patches
> >> Tom's recent patch to improve stale lockfile detection included a
> >> call to getppid() which doesn't exist on Windows.
> >> There is no clean way to implement one (previously discussed on
> >> hackers-win32) hence the attach patch simply #ifdefs out the call.
>
> Done.  I think this is no real problem for Windows, since its
> implementation of the kill(pid,0) check is not going to be
> fooled by parent processes anyway.

Correct. It will only catch an actual postgresql process.

Also, the logic was broken anyway since win32 assigns PIDs in a random
order and not sequential.. The probability you will get the same PID
after reboot is *very* low.

//mha

pgsql-patches by date:

Previous
From: Tom Lane
Date:
Subject: Re: FW: Win32 fix for miscinit.c
Next
From: "Marc G. Fournier"
Date:
Subject: Re: license cleanup