1
0
mirror of https://github.com/postgres/postgres.git synced 2025-09-02 04:21:28 +03:00

Win32 signals cleanup. Patch by Magnus Hagander, with input from Claudio

Natoli and Bruce Momjian (and some cosmetic fixes from Neil Conway).
Changes:

    - remove duplicate signal definitions from pqsignal.h

    - replace pqkill() with kill() and redefine kill() in Win32

    - use ereport() in place of fprintf() in some error handling in
      pqsignal.c

    - export pg_queue_signal() and make use of it where necessary

    - add a console control handler for Ctrl-C and similar handling
      on Win32

    - do WaitForSingleObjectEx() in CHECK_FOR_INTERRUPTS() on Win32;
      query cancelling should now work on Win32

    - various other fixes and cleanups
This commit is contained in:
Neil Conway
2004-02-08 22:28:57 +00:00
parent 04e82e5008
commit f06e79525a
11 changed files with 118 additions and 163 deletions

View File

@@ -8,7 +8,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/port/sysv_sema.c,v 1.13 2004/01/27 00:45:26 momjian Exp $
* $PostgreSQL: pgsql/src/backend/port/sysv_sema.c,v 1.14 2004/02/08 22:28:56 neilc Exp $
*
*-------------------------------------------------------------------------
*/
@@ -31,7 +31,6 @@
#include "miscadmin.h"
#include "storage/ipc.h"
#include "storage/pg_sema.h"
#include "libpq/pqsignal.h"
#ifndef HAVE_UNION_SEMUN
@@ -233,8 +232,7 @@ IpcSemaphoreCreate(int numSems)
continue; /* oops, GETPID failed */
if (creatorPID != getpid())
{
if (pqkill(creatorPID, 0) == 0 ||
errno != ESRCH)
if (kill(creatorPID, 0) == 0 || errno != ESRCH)
continue; /* sema belongs to a live process */
}