mirror of
https://github.com/postgres/postgres.git
synced 2025-07-27 12:41:57 +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:
@ -10,7 +10,7 @@
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/port/sysv_shmem.c,v 1.30 2004/02/02 00:11:31 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/port/sysv_shmem.c,v 1.31 2004/02/08 22:28:56 neilc Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -33,7 +33,6 @@
|
||||
#include "miscadmin.h"
|
||||
#include "storage/ipc.h"
|
||||
#include "storage/pg_shmem.h"
|
||||
#include "libpq/pqsignal.h"
|
||||
|
||||
|
||||
typedef key_t IpcMemoryKey; /* shared memory key passed to shmget(2) */
|
||||
@ -304,7 +303,7 @@ PGSharedMemoryCreate(uint32 size, bool makePrivate, int port)
|
||||
hdr = (PGShmemHeader *) memAddress;
|
||||
if (hdr->creatorPID != getpid())
|
||||
{
|
||||
if (pqkill(hdr->creatorPID, 0) == 0 || errno != ESRCH)
|
||||
if (kill(hdr->creatorPID, 0) == 0 || errno != ESRCH)
|
||||
{
|
||||
shmdt(memAddress);
|
||||
continue; /* segment belongs to a live process */
|
||||
|
Reference in New Issue
Block a user