mirror of
https://github.com/postgres/postgres.git
synced 2025-07-28 23:42:10 +03:00
8.4 pgindent run, with new combined Linux/FreeBSD/MinGW typedef list
provided by Andrew.
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $PostgreSQL: pgsql/src/backend/port/darwin/system.c,v 1.7 2008/05/17 01:28:22 adunstan Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/port/darwin/system.c,v 1.8 2009/06/11 14:49:00 momjian Exp $
|
||||
*
|
||||
* only needed in OS X 10.1 and possibly early 10.2 releases */
|
||||
#include <AvailabilityMacros.h>
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $PostgreSQL: pgsql/src/backend/port/dynloader/sco.c,v 1.2 2008/05/17 01:28:23 adunstan Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/port/dynloader/sco.c,v 1.3 2009/06/11 14:49:00 momjian Exp $
|
||||
*
|
||||
* Dummy file used for nothing at this point
|
||||
*
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $PostgreSQL: pgsql/src/backend/port/dynloader/solaris.c,v 1.2 2008/05/17 01:28:23 adunstan Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/port/dynloader/solaris.c,v 1.3 2009/06/11 14:49:00 momjian Exp $
|
||||
*
|
||||
* Dummy file used for nothing at this point
|
||||
*
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $PostgreSQL: pgsql/src/backend/port/dynloader/sunos4.c,v 1.2 2008/05/17 01:28:23 adunstan Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/port/dynloader/sunos4.c,v 1.3 2009/06/11 14:49:00 momjian Exp $
|
||||
*
|
||||
* Dummy file used for nothing at this point
|
||||
*
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $PostgreSQL: pgsql/src/backend/port/dynloader/svr4.c,v 1.2 2008/05/17 01:28:23 adunstan Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/port/dynloader/svr4.c,v 1.3 2009/06/11 14:49:00 momjian Exp $
|
||||
*
|
||||
* Dummy file used for nothing at this point
|
||||
*
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $PostgreSQL: pgsql/src/backend/port/dynloader/univel.c,v 1.4 2008/05/17 01:28:23 adunstan Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/port/dynloader/univel.c,v 1.5 2009/06/11 14:49:00 momjian Exp $
|
||||
*
|
||||
* Dummy file used for nothing at this point
|
||||
*
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $PostgreSQL: pgsql/src/backend/port/dynloader/univel.h,v 1.23 2009/01/01 17:23:46 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/port/dynloader/univel.h,v 1.24 2009/06/11 14:49:00 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $PostgreSQL: pgsql/src/backend/port/dynloader/unixware.c,v 1.2 2008/05/17 01:28:23 adunstan Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/port/dynloader/unixware.c,v 1.3 2009/06/11 14:49:00 momjian Exp $
|
||||
*
|
||||
* Dummy file used for nothing at this point
|
||||
*
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $PostgreSQL: pgsql/src/backend/port/dynloader/unixware.h,v 1.21 2009/01/01 17:23:46 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/port/dynloader/unixware.h,v 1.22 2009/06/11 14:49:00 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $PostgreSQL: pgsql/src/backend/port/dynloader/win32.h,v 1.4 2008/05/17 01:28:23 adunstan Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/port/dynloader/win32.h,v 1.5 2009/06/11 14:49:00 momjian Exp $
|
||||
*/
|
||||
#ifndef PORT_PROTOS_H
|
||||
#define PORT_PROTOS_H
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $PostgreSQL: pgsql/src/backend/port/nextstep/port.c,v 1.11 2008/05/17 01:28:23 adunstan Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/port/nextstep/port.c,v 1.12 2009/06/11 14:49:00 momjian Exp $
|
||||
*/
|
||||
#include "postgres.h"
|
||||
|
||||
|
@ -11,7 +11,7 @@
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/port/posix_sema.c,v 1.21 2009/01/01 17:23:46 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/port/posix_sema.c,v 1.22 2009/06/11 14:49:00 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -241,10 +241,10 @@ PGSemaphoreLock(PGSemaphore sema, bool interruptOK)
|
||||
int errStatus;
|
||||
|
||||
/*
|
||||
* See notes in sysv_sema.c's implementation of PGSemaphoreLock.
|
||||
* Just as that code does for semop(), we handle both the case where
|
||||
* sem_wait() returns errno == EINTR after a signal, and the case
|
||||
* where it just keeps waiting.
|
||||
* See notes in sysv_sema.c's implementation of PGSemaphoreLock. Just as
|
||||
* that code does for semop(), we handle both the case where sem_wait()
|
||||
* returns errno == EINTR after a signal, and the case where it just keeps
|
||||
* waiting.
|
||||
*/
|
||||
do
|
||||
{
|
||||
|
@ -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.24 2009/01/01 17:23:46 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/port/sysv_sema.c,v 1.25 2009/06/11 14:49:00 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -377,11 +377,11 @@ PGSemaphoreLock(PGSemaphore sema, bool interruptOK)
|
||||
* from the operation prematurely because we were sent a signal. So we
|
||||
* try and lock the semaphore again.
|
||||
*
|
||||
* Each time around the loop, we check for a cancel/die interrupt. On
|
||||
* some platforms, if such an interrupt comes in while we are waiting,
|
||||
* it will cause the semop() call to exit with errno == EINTR, allowing
|
||||
* us to service the interrupt (if not in a critical section already)
|
||||
* during the next loop iteration.
|
||||
* Each time around the loop, we check for a cancel/die interrupt. On
|
||||
* some platforms, if such an interrupt comes in while we are waiting, it
|
||||
* will cause the semop() call to exit with errno == EINTR, allowing us to
|
||||
* service the interrupt (if not in a critical section already) during the
|
||||
* next loop iteration.
|
||||
*
|
||||
* Once we acquire the lock, we do NOT check for an interrupt before
|
||||
* returning. The caller needs to be able to record ownership of the lock
|
||||
@ -407,10 +407,10 @@ PGSemaphoreLock(PGSemaphore sema, bool interruptOK)
|
||||
*
|
||||
* On some platforms, signals marked SA_RESTART (which is most, for us)
|
||||
* will not interrupt the semop(); it will just keep waiting. Therefore
|
||||
* it's necessary for cancel/die interrupts to be serviced directly by
|
||||
* the signal handler. On these platforms the behavior is really the same
|
||||
* it's necessary for cancel/die interrupts to be serviced directly by the
|
||||
* signal handler. On these platforms the behavior is really the same
|
||||
* whether the signal arrives just before the semop() begins, or while it
|
||||
* is waiting. The loop on EINTR is thus important only for other types
|
||||
* is waiting. The loop on EINTR is thus important only for other types
|
||||
* of interrupts.
|
||||
*/
|
||||
do
|
||||
|
@ -6,7 +6,7 @@
|
||||
* Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/port/win32/mingwcompat.c,v 1.5 2009/01/01 17:23:46 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/port/win32/mingwcompat.c,v 1.6 2009/06/11 14:49:00 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -45,8 +45,8 @@ LoadKernel32()
|
||||
* kernel32.dll·
|
||||
*/
|
||||
typedef
|
||||
BOOL(WINAPI * __RegisterWaitForSingleObject)
|
||||
(PHANDLE, HANDLE, WAITORTIMERCALLBACK, PVOID, ULONG, ULONG);
|
||||
BOOL (WINAPI * __RegisterWaitForSingleObject)
|
||||
(PHANDLE, HANDLE, WAITORTIMERCALLBACK, PVOID, ULONG, ULONG);
|
||||
static __RegisterWaitForSingleObject _RegisterWaitForSingleObject = NULL;
|
||||
|
||||
BOOL WINAPI
|
||||
|
@ -6,7 +6,7 @@
|
||||
* Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/port/win32/socket.c,v 1.21 2009/01/01 17:23:46 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/port/win32/socket.c,v 1.22 2009/06/11 14:49:00 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -434,7 +434,8 @@ pgwin32_select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, c
|
||||
|
||||
r = WSASend(writefds->fd_array[i], &buf, 1, &sent, 0, NULL, NULL);
|
||||
if (r == 0) /* Completed - means things are fine! */
|
||||
FD_SET(writefds->fd_array[i], &outwritefds);
|
||||
FD_SET (writefds->fd_array[i], &outwritefds);
|
||||
|
||||
else
|
||||
{ /* Not completed */
|
||||
if (WSAGetLastError() != WSAEWOULDBLOCK)
|
||||
@ -443,7 +444,7 @@ pgwin32_select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, c
|
||||
* Not completed, and not just "would block", so an error
|
||||
* occured
|
||||
*/
|
||||
FD_SET(writefds->fd_array[i], &outwritefds);
|
||||
FD_SET (writefds->fd_array[i], &outwritefds);
|
||||
}
|
||||
}
|
||||
if (outwritefds.fd_count > 0)
|
||||
@ -530,7 +531,8 @@ pgwin32_select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, c
|
||||
(resEvents.lNetworkEvents & FD_ACCEPT) ||
|
||||
(resEvents.lNetworkEvents & FD_CLOSE))
|
||||
{
|
||||
FD_SET(sockets[i], &outreadfds);
|
||||
FD_SET (sockets[i], &outreadfds);
|
||||
|
||||
nummatches++;
|
||||
}
|
||||
}
|
||||
@ -540,7 +542,8 @@ pgwin32_select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, c
|
||||
if ((resEvents.lNetworkEvents & FD_WRITE) ||
|
||||
(resEvents.lNetworkEvents & FD_CLOSE))
|
||||
{
|
||||
FD_SET(sockets[i], &outwritefds);
|
||||
FD_SET (sockets[i], &outwritefds);
|
||||
|
||||
nummatches++;
|
||||
}
|
||||
}
|
||||
|
@ -11,7 +11,7 @@
|
||||
* Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/port/win32/timer.c,v 1.16 2009/01/01 17:23:46 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/port/win32/timer.c,v 1.17 2009/06/11 14:49:00 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -27,7 +27,7 @@ typedef struct timerCA
|
||||
struct itimerval value;
|
||||
HANDLE event;
|
||||
CRITICAL_SECTION crit_sec;
|
||||
} timerCA;
|
||||
} timerCA;
|
||||
|
||||
static timerCA timerCommArea;
|
||||
static HANDLE timerThreadHandle = INVALID_HANDLE_VALUE;
|
||||
|
@ -6,7 +6,7 @@
|
||||
* Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/port/win32_sema.c,v 1.8 2009/01/01 17:23:46 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/port/win32_sema.c,v 1.9 2009/06/11 14:49:00 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -125,10 +125,10 @@ PGSemaphoreLock(PGSemaphore sema, bool interruptOK)
|
||||
wh[1] = pgwin32_signal_event;
|
||||
|
||||
/*
|
||||
* As in other implementations of PGSemaphoreLock, we need to check
|
||||
* for cancel/die interrupts each time through the loop. But here,
|
||||
* there is no hidden magic about whether the syscall will internally
|
||||
* service a signal --- we do that ourselves.
|
||||
* As in other implementations of PGSemaphoreLock, we need to check for
|
||||
* cancel/die interrupts each time through the loop. But here, there is
|
||||
* no hidden magic about whether the syscall will internally service a
|
||||
* signal --- we do that ourselves.
|
||||
*/
|
||||
do
|
||||
{
|
||||
|
@ -6,7 +6,7 @@
|
||||
* Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/port/win32_shmem.c,v 1.10 2009/05/05 21:51:46 tgl Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/port/win32_shmem.c,v 1.11 2009/06/11 14:49:00 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -57,11 +57,11 @@ GetSharedMemName(void)
|
||||
elog(FATAL, "could not generate full pathname for datadir %s: %lu",
|
||||
DataDir, GetLastError());
|
||||
|
||||
/*
|
||||
/*
|
||||
* XXX: Intentionally overwriting the Global\ part here. This was not the
|
||||
* original approach, but putting it in the actual Global\ namespace
|
||||
* causes permission errors in a lot of cases, so we leave it in
|
||||
* the default namespace for now.
|
||||
* causes permission errors in a lot of cases, so we leave it in the
|
||||
* default namespace for now.
|
||||
*/
|
||||
for (cp = retptr; *cp; cp++)
|
||||
if (*cp == '\\')
|
||||
@ -135,19 +135,22 @@ PGSharedMemoryCreate(Size size, bool makePrivate, int port)
|
||||
/*
|
||||
* When recycling a shared memory segment, it may take a short while
|
||||
* before it gets dropped from the global namespace. So re-try after
|
||||
* sleeping for a second, and continue retrying 10 times.
|
||||
* (both the 1 second time and the 10 retries are completely arbitrary)
|
||||
* sleeping for a second, and continue retrying 10 times. (both the 1
|
||||
* second time and the 10 retries are completely arbitrary)
|
||||
*/
|
||||
for (i = 0; i < 10; i++)
|
||||
{
|
||||
/* In case CreateFileMapping() doesn't set the error code to 0 on success */
|
||||
/*
|
||||
* In case CreateFileMapping() doesn't set the error code to 0 on
|
||||
* success
|
||||
*/
|
||||
SetLastError(0);
|
||||
|
||||
hmap = CreateFileMapping((HANDLE) 0xFFFFFFFF, /* Use the pagefile */
|
||||
NULL, /* Default security attrs */
|
||||
PAGE_READWRITE, /* Memory is Read/Write */
|
||||
hmap = CreateFileMapping((HANDLE) 0xFFFFFFFF, /* Use the pagefile */
|
||||
NULL, /* Default security attrs */
|
||||
PAGE_READWRITE, /* Memory is Read/Write */
|
||||
0L, /* Size Upper 32 Bits */
|
||||
(DWORD) size, /* Size Lower 32 bits */
|
||||
(DWORD) size, /* Size Lower 32 bits */
|
||||
szShareMem);
|
||||
|
||||
if (!hmap)
|
||||
@ -162,8 +165,8 @@ PGSharedMemoryCreate(Size size, bool makePrivate, int port)
|
||||
*/
|
||||
if (GetLastError() == ERROR_ALREADY_EXISTS)
|
||||
{
|
||||
CloseHandle(hmap); /* Close the handle, since we got a valid
|
||||
* one to the previous segment. */
|
||||
CloseHandle(hmap); /* Close the handle, since we got a valid one
|
||||
* to the previous segment. */
|
||||
hmap = NULL;
|
||||
Sleep(1000);
|
||||
continue;
|
||||
@ -177,8 +180,8 @@ PGSharedMemoryCreate(Size size, bool makePrivate, int port)
|
||||
*/
|
||||
if (!hmap)
|
||||
ereport(FATAL,
|
||||
(errmsg("pre-existing shared memory block is still in use"),
|
||||
errhint("Check if there are any old server processes still running, and terminate them.")));
|
||||
(errmsg("pre-existing shared memory block is still in use"),
|
||||
errhint("Check if there are any old server processes still running, and terminate them.")));
|
||||
|
||||
free(szShareMem);
|
||||
|
||||
|
Reference in New Issue
Block a user