Re: postmaster.pid

From: "Dave Page" <dpage(at)vale-housing(dot)co(dot)uk>
To: "Dave Page" <dpage(at)vale-housing(dot)co(dot)uk>, "Andrew Dunstan" <andrew(at)dunslane(dot)net>
Cc: "Barry Lind" <blind(at)xythos(dot)com>, <pgsql-hackers-win32(at)postgresql(dot)org>, "Max Dunn" <mdunn(at)xythos(dot)com>
Subject: Re: postmaster.pid
Date: 2004-08-24 15:59:18
Message-ID: E7F85A1B5FF8D44C8A1AF6885BC9A0E41A7870@ratbert.vale-housing.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers-win32

> -----Original Message-----
> From: pgsql-hackers-win32-owner(at)postgresql(dot)org
> [mailto:pgsql-hackers-win32-owner(at)postgresql(dot)org] On Behalf
> Of Dave Page
> Sent: 24 August 2004 15:55
> To: Andrew Dunstan
> Cc: Barry Lind; pgsql-hackers-win32(at)postgresql(dot)org; Max Dunn
> Subject: Re: [pgsql-hackers-win32] postmaster.pid
>
>
>
> however I have an hour or so now so I'll take a
> quick look at the kill() issue.

OK, quick (untested) hack below. Open to suggestions if anyone's got a
better way to do it...

Regards, Dave

Index: kill.c
===================================================================
RCS file: /projects/cvsroot/pgsql-server/src/port/kill.c,v
retrieving revision 1.2
diff -u -r1.2 kill.c
--- kill.c 24 Jun 2004 18:53:48 -0000 1.2
+++ kill.c 24 Aug 2004 15:56:03 -0000
@@ -25,8 +25,25 @@
BYTE sigData = sig;
BYTE sigRet = 0;
DWORD bytes;
+ DWORD handle;

- if (sig >= PG_SIGNAL_COUNT || sig <= 0)
+ /* Look, but don't touch... */
+ if (sig == 0)
+ {
+ handle = OpenProcess(PROCESS_QUERY_INFORMATION, FALSE,
pid);
+ if (!handle)
+ {
+ errno = EINVAL;
+ return -1;
+ }
+ else
+ {
+ CloseHandle(handle);
+ return 0;
+ }
+ }
+
+ /* Regular kill... */
+ if (sig >= PG_SIGNAL_COUNT || sig < 0)
{
errno = EINVAL;
return -1;

Browse pgsql-hackers-win32 by date

  From Date Subject
Next Message Tom Lane 2004-08-24 15:59:34 Re: postmaster.pid
Previous Message Vidyasagara Guntaka 2004-08-24 15:23:37 Not able to build libpq for Windows using 8.0.0 beta1