summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane2004-08-27 18:31:48 +0000
committerTom Lane2004-08-27 18:31:48 +0000
commit1ae5450d76b0a9fc653cb6a27e11988b2dbeffbf (patch)
treef5bb6a91702bb8fc9630ee93f83ff387e49eec8a
parentd453ff9ac47bcf9a20cba1835ba1cd034257457d (diff)
Fix Windows emulation of kill(pid, 0). This will now succeed, but only
if the target PID is a PG postmaster or backend --- for our purposes that is actually better than the Unix behavior. Per Dave Page and Andrew Dunstan.
-rw-r--r--src/backend/port/win32/signal.c2
-rw-r--r--src/port/kill.c3
2 files changed, 3 insertions, 2 deletions
diff --git a/src/backend/port/win32/signal.c b/src/backend/port/win32/signal.c
index a451a2a8ff..0f5488211c 100644
--- a/src/backend/port/win32/signal.c
+++ b/src/backend/port/win32/signal.c
@@ -162,7 +162,7 @@ pqsignal(int signum, pqsigfunc handler)
void
pg_queue_signal(int signum)
{
- if (signum >= PG_SIGNAL_COUNT || signum < 0)
+ if (signum >= PG_SIGNAL_COUNT || signum <= 0)
return;
EnterCriticalSection(&pg_signal_crit_sec);
diff --git a/src/port/kill.c b/src/port/kill.c
index ea9b85872a..0f0e17e422 100644
--- a/src/port/kill.c
+++ b/src/port/kill.c
@@ -26,7 +26,8 @@ pgkill(int pid, int sig)
BYTE sigRet = 0;
DWORD bytes;
- if (sig >= PG_SIGNAL_COUNT || sig <= 0)
+ /* we allow signal 0 here, but it will be ignored in pg_queue_signal */
+ if (sig >= PG_SIGNAL_COUNT || sig < 0)
{
errno = EINVAL;
return -1;