mirror of
https://github.com/postgres/postgres.git
synced 2025-07-20 05:03:10 +03:00
pgindent run for 9.0
This commit is contained in:
@ -6,7 +6,7 @@
|
||||
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/port/win32/mingwcompat.c,v 1.10 2010/02/09 20:22:20 mha Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/port/win32/mingwcompat.c,v 1.11 2010/02/26 02:00:53 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -19,7 +19,7 @@
|
||||
* in any library. It's trivial enough that we can safely define it
|
||||
* ourselves.
|
||||
*/
|
||||
const struct in6_addr in6addr_any = {{{0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0}}};
|
||||
const struct in6_addr in6addr_any = {{{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}};
|
||||
|
||||
|
||||
/*
|
||||
|
@ -6,7 +6,7 @@
|
||||
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/port/win32/signal.c,v 1.24 2010/01/31 17:16:23 mha Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/port/win32/signal.c,v 1.25 2010/02/26 02:00:53 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -275,31 +275,34 @@ pg_signal_thread(LPVOID param)
|
||||
fConnected = ConnectNamedPipe(pipe, NULL) ? TRUE : (GetLastError() == ERROR_PIPE_CONNECTED);
|
||||
if (fConnected)
|
||||
{
|
||||
HANDLE newpipe;
|
||||
HANDLE newpipe;
|
||||
|
||||
/*
|
||||
* We have a connected pipe. Pass this off to a separate thread that will do the actual
|
||||
* processing of the pipe.
|
||||
* We have a connected pipe. Pass this off to a separate thread
|
||||
* that will do the actual processing of the pipe.
|
||||
*
|
||||
* We must also create a new instance of the pipe *before* we start running the new
|
||||
* thread. If we don't, there is a race condition whereby the dispatch thread might
|
||||
* run CloseHandle() before we have created a new instance, thereby causing a small
|
||||
* We must also create a new instance of the pipe *before* we
|
||||
* start running the new thread. If we don't, there is a race
|
||||
* condition whereby the dispatch thread might run CloseHandle()
|
||||
* before we have created a new instance, thereby causing a small
|
||||
* window of time where we will miss incoming requests.
|
||||
*/
|
||||
newpipe = CreateNamedPipe(pipename, PIPE_ACCESS_DUPLEX,
|
||||
PIPE_TYPE_MESSAGE | PIPE_READMODE_MESSAGE | PIPE_WAIT,
|
||||
PIPE_UNLIMITED_INSTANCES, 16, 16, 1000, NULL);
|
||||
PIPE_TYPE_MESSAGE | PIPE_READMODE_MESSAGE | PIPE_WAIT,
|
||||
PIPE_UNLIMITED_INSTANCES, 16, 16, 1000, NULL);
|
||||
if (newpipe == INVALID_HANDLE_VALUE)
|
||||
{
|
||||
/*
|
||||
* This really should never fail. Just retry in case it does, even though we have
|
||||
* a small race window in that case. There is nothing else we can do other than
|
||||
* abort the whole process which will be even worse.
|
||||
* This really should never fail. Just retry in case it does,
|
||||
* even though we have a small race window in that case. There
|
||||
* is nothing else we can do other than abort the whole
|
||||
* process which will be even worse.
|
||||
*/
|
||||
write_stderr("could not create signal listener pipe: error code %d; retrying\n", (int) GetLastError());
|
||||
|
||||
/*
|
||||
* Keep going so we at least dispatch this signal. Hopefully, the call will succeed
|
||||
* when retried in the loop soon after.
|
||||
* Keep going so we at least dispatch this signal. Hopefully,
|
||||
* the call will succeed when retried in the loop soon after.
|
||||
*/
|
||||
}
|
||||
hThread = CreateThread(NULL, 0,
|
||||
@ -312,8 +315,9 @@ pg_signal_thread(LPVOID param)
|
||||
CloseHandle(hThread);
|
||||
|
||||
/*
|
||||
* Background thread is running with our instance of the pipe. So replace our reference
|
||||
* with the newly created one and loop back up for another run.
|
||||
* Background thread is running with our instance of the pipe. So
|
||||
* replace our reference with the newly created one and loop back
|
||||
* up for another run.
|
||||
*/
|
||||
pipe = newpipe;
|
||||
}
|
||||
@ -322,8 +326,8 @@ pg_signal_thread(LPVOID param)
|
||||
/*
|
||||
* Connection failed. Cleanup and try again.
|
||||
*
|
||||
* This should never happen. If it does, we have a small race condition until we loop
|
||||
* up and re-create the pipe.
|
||||
* This should never happen. If it does, we have a small race
|
||||
* condition until we loop up and re-create the pipe.
|
||||
*/
|
||||
CloseHandle(pipe);
|
||||
pipe = INVALID_HANDLE_VALUE;
|
||||
|
@ -6,7 +6,7 @@
|
||||
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/port/win32/socket.c,v 1.25 2010/02/17 05:51:40 mha Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/port/win32/socket.c,v 1.26 2010/02/26 02:00:53 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -24,7 +24,7 @@
|
||||
* This flag changes the behaviour *globally* for all socket operations,
|
||||
* so it should only be set for very short periods of time.
|
||||
*/
|
||||
int pgwin32_noblock = 0;
|
||||
int pgwin32_noblock = 0;
|
||||
|
||||
#undef socket
|
||||
#undef accept
|
||||
@ -326,8 +326,8 @@ pgwin32_recv(SOCKET s, char *buf, int len, int f)
|
||||
if (pgwin32_noblock)
|
||||
{
|
||||
/*
|
||||
* No data received, and we are in "emulated non-blocking mode", so return
|
||||
* indicating that we'd block if we were to continue.
|
||||
* No data received, and we are in "emulated non-blocking mode", so
|
||||
* return indicating that we'd block if we were to continue.
|
||||
*/
|
||||
errno = EWOULDBLOCK;
|
||||
return -1;
|
||||
|
@ -6,7 +6,7 @@
|
||||
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/port/win32_shmem.c,v 1.15 2010/01/04 01:06:21 itagaki Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/port/win32_shmem.c,v 1.16 2010/02/26 02:00:53 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -159,8 +159,8 @@ PGSharedMemoryCreate(Size size, bool makePrivate, int port)
|
||||
hmap = CreateFileMapping(INVALID_HANDLE_VALUE, /* Use the pagefile */
|
||||
NULL, /* Default security attrs */
|
||||
PAGE_READWRITE, /* Memory is Read/Write */
|
||||
size_high, /* Size Upper 32 Bits */
|
||||
size_low, /* Size Lower 32 bits */
|
||||
size_high, /* Size Upper 32 Bits */
|
||||
size_low, /* Size Lower 32 bits */
|
||||
szShareMem);
|
||||
|
||||
if (!hmap)
|
||||
@ -341,14 +341,15 @@ pgwin32_SharedMemoryDelete(int status, Datum shmId)
|
||||
int
|
||||
pgwin32_ReserveSharedMemoryRegion(HANDLE hChild)
|
||||
{
|
||||
void *address;
|
||||
void *address;
|
||||
|
||||
Assert(UsedShmemSegAddr != NULL);
|
||||
Assert(UsedShmemSegSize != 0);
|
||||
|
||||
address = VirtualAllocEx(hChild, UsedShmemSegAddr, UsedShmemSegSize,
|
||||
MEM_RESERVE, PAGE_READWRITE);
|
||||
if (address == NULL) {
|
||||
MEM_RESERVE, PAGE_READWRITE);
|
||||
if (address == NULL)
|
||||
{
|
||||
/* Don't use FATAL since we're running in the postmaster */
|
||||
elog(LOG, "could not reserve shared memory region (addr=%p) for child %p: %lu",
|
||||
UsedShmemSegAddr, hChild, GetLastError());
|
||||
@ -357,12 +358,12 @@ pgwin32_ReserveSharedMemoryRegion(HANDLE hChild)
|
||||
if (address != UsedShmemSegAddr)
|
||||
{
|
||||
/*
|
||||
* Should never happen - in theory if allocation granularity causes strange
|
||||
* effects it could, so check just in case.
|
||||
* Should never happen - in theory if allocation granularity causes
|
||||
* strange effects it could, so check just in case.
|
||||
*
|
||||
* Don't use FATAL since we're running in the postmaster.
|
||||
*/
|
||||
elog(LOG, "reserved shared memory region got incorrect address %p, expected %p",
|
||||
elog(LOG, "reserved shared memory region got incorrect address %p, expected %p",
|
||||
address, UsedShmemSegAddr);
|
||||
VirtualFreeEx(hChild, address, 0, MEM_RELEASE);
|
||||
return false;
|
||||
|
Reference in New Issue
Block a user