aboutsummaryrefslogtreecommitdiff
path: root/src/backend/port/win32_shmem.c
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2009-06-11 14:49:15 +0000
committerBruce Momjian <bruce@momjian.us>2009-06-11 14:49:15 +0000
commitd7471402794266078953f1bd113dab4913d631a1 (patch)
tree618e392a84eaf837e00bf78f8694097b78fec227 /src/backend/port/win32_shmem.c
parent4e86efb4e51b66ef57b3fe6f28576de23a1bf1c6 (diff)
downloadpostgresql-d7471402794266078953f1bd113dab4913d631a1.tar.gz
postgresql-d7471402794266078953f1bd113dab4913d631a1.zip
8.4 pgindent run, with new combined Linux/FreeBSD/MinGW typedef list
provided by Andrew.
Diffstat (limited to 'src/backend/port/win32_shmem.c')
-rw-r--r--src/backend/port/win32_shmem.c33
1 files changed, 18 insertions, 15 deletions
diff --git a/src/backend/port/win32_shmem.c b/src/backend/port/win32_shmem.c
index 5651a31e44c..4e819d0c65b 100644
--- a/src/backend/port/win32_shmem.c
+++ b/src/backend/port/win32_shmem.c
@@ -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);