mirror of
https://github.com/postgres/postgres.git
synced 2025-09-02 04:21:28 +03:00
pgindent run.
This commit is contained in:
@@ -291,8 +291,8 @@ semop(int semId, struct sembuf * sops, int nsops)
|
||||
if (sops[i].sem_op < 0)
|
||||
{
|
||||
/*
|
||||
* Try acquiring the semaphore till we are not interrupted by a
|
||||
* signal
|
||||
* Try acquiring the semaphore till we are not interrupted by
|
||||
* a signal
|
||||
*/
|
||||
if (sops[i].sem_flg == IPC_NOWAIT)
|
||||
{
|
||||
|
@@ -3,7 +3,7 @@
|
||||
* available with a PostgreSQL-compatible license. Kudos Wilfredo
|
||||
* S<>nchez <wsanchez@apple.com>.
|
||||
*
|
||||
* $Header: /cvsroot/pgsql/src/backend/port/dynloader/darwin.c,v 1.7 2003/04/13 01:19:06 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/port/dynloader/darwin.c,v 1.8 2003/08/04 00:43:21 momjian Exp $
|
||||
*/
|
||||
#include "postgres.h"
|
||||
|
||||
@@ -58,7 +58,7 @@ char *
|
||||
pg_dlerror(void)
|
||||
{
|
||||
NSLinkEditErrors c;
|
||||
int errorNumber;
|
||||
int errorNumber;
|
||||
const char *fileName;
|
||||
const char *errorString = NULL;
|
||||
|
||||
|
@@ -11,7 +11,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/port/dynloader/linux.c,v 1.24 2003/07/22 23:30:39 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/port/dynloader/linux.c,v 1.25 2003/08/04 00:43:21 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -131,4 +131,4 @@ pg_dlerror(void)
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif /* !HAVE_DLOPEN */
|
||||
#endif /* !HAVE_DLOPEN */
|
||||
|
@@ -7,7 +7,7 @@
|
||||
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $Id: linux.h,v 1.19 2002/10/15 16:04:17 tgl Exp $
|
||||
* $Id: linux.h,v 1.20 2003/08/04 00:43:21 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -39,7 +39,6 @@
|
||||
#define pg_dlsym dlsym
|
||||
#define pg_dlclose dlclose
|
||||
#define pg_dlerror dlerror
|
||||
|
||||
#endif /* HAVE_DLOPEN */
|
||||
|
||||
#endif /* PORT_PROTOS_H */
|
||||
|
@@ -1,4 +1,4 @@
|
||||
/* $Header: /cvsroot/pgsql/src/backend/port/dynloader/win32.c,v 1.1 2003/05/15 16:35:29 momjian Exp $ */
|
||||
/* $Header: /cvsroot/pgsql/src/backend/port/dynloader/win32.c,v 1.2 2003/08/04 00:43:21 momjian Exp $ */
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
@@ -11,17 +11,17 @@ dlerror(void)
|
||||
int
|
||||
dlclose(void *handle)
|
||||
{
|
||||
return FreeLibrary((HMODULE)handle) ? 0 : 1;
|
||||
return FreeLibrary((HMODULE) handle) ? 0 : 1;
|
||||
}
|
||||
|
||||
void *
|
||||
dlsym(void *handle, const char *symbol)
|
||||
{
|
||||
return (void *)GetProcAddress((HMODULE)handle, symbol);
|
||||
return (void *) GetProcAddress((HMODULE) handle, symbol);
|
||||
}
|
||||
|
||||
void *
|
||||
dlopen(const char *path, int mode)
|
||||
{
|
||||
return (void *)LoadLibrary(path);
|
||||
return (void *) LoadLibrary(path);
|
||||
}
|
||||
|
@@ -21,7 +21,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/port/ipc_test.c,v 1.7 2003/07/27 21:49:54 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/port/ipc_test.c,v 1.8 2003/08/04 00:43:21 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -140,13 +140,13 @@ errstart(int elevel, const char *filename, int lineno,
|
||||
}
|
||||
|
||||
void
|
||||
errfinish(int dummy, ...)
|
||||
errfinish(int dummy,...)
|
||||
{
|
||||
proc_exit(1);
|
||||
}
|
||||
|
||||
void
|
||||
elog_finish(int elevel, const char *fmt, ...)
|
||||
elog_finish(int elevel, const char *fmt,...)
|
||||
{
|
||||
fprintf(stderr, "ERROR: %s\n", fmt);
|
||||
proc_exit(1);
|
||||
@@ -159,28 +159,28 @@ errcode(int sqlerrcode)
|
||||
}
|
||||
|
||||
int
|
||||
errmsg(const char *fmt, ...)
|
||||
errmsg(const char *fmt,...)
|
||||
{
|
||||
fprintf(stderr, "ERROR: %s\n", fmt);
|
||||
return 0; /* return value does not matter */
|
||||
}
|
||||
|
||||
int
|
||||
errmsg_internal(const char *fmt, ...)
|
||||
errmsg_internal(const char *fmt,...)
|
||||
{
|
||||
fprintf(stderr, "ERROR: %s\n", fmt);
|
||||
return 0; /* return value does not matter */
|
||||
}
|
||||
|
||||
int
|
||||
errdetail(const char *fmt, ...)
|
||||
errdetail(const char *fmt,...)
|
||||
{
|
||||
fprintf(stderr, "DETAIL: %s\n", fmt);
|
||||
return 0; /* return value does not matter */
|
||||
}
|
||||
|
||||
int
|
||||
errhint(const char *fmt, ...)
|
||||
errhint(const char *fmt,...)
|
||||
{
|
||||
fprintf(stderr, "HINT: %s\n", fmt);
|
||||
return 0; /* return value does not matter */
|
||||
|
@@ -11,7 +11,7 @@
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/port/posix_sema.c,v 1.8 2003/07/27 21:49:54 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/port/posix_sema.c,v 1.9 2003/08/04 00:43:21 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -114,7 +114,6 @@ PosixSemaphoreCreate(sem_t * sem)
|
||||
if (sem_init(sem, 1, 1) < 0)
|
||||
elog(FATAL, "sem_init failed: %m");
|
||||
}
|
||||
|
||||
#endif /* USE_NAMED_POSIX_SEMAPHORES */
|
||||
|
||||
|
||||
|
@@ -8,7 +8,7 @@
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/port/sysv_sema.c,v 1.7 2003/07/27 21:49:54 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/port/sysv_sema.c,v 1.8 2003/08/04 00:43:21 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -121,12 +121,12 @@ InternalIpcSemaphoreCreate(IpcSemaphoreKey semKey, int numSems)
|
||||
(errno == ENOSPC) ?
|
||||
errhint("This error does *not* mean that you have run out of disk space.\n"
|
||||
"It occurs when either the system limit for the maximum number of "
|
||||
"semaphore sets (SEMMNI), or the system wide maximum number of "
|
||||
"semaphores (SEMMNS), would be exceeded. You need to raise the "
|
||||
"semaphore sets (SEMMNI), or the system wide maximum number of "
|
||||
"semaphores (SEMMNS), would be exceeded. You need to raise the "
|
||||
"respective kernel parameter. Alternatively, reduce PostgreSQL's "
|
||||
"consumption of semaphores by reducing its max_connections parameter "
|
||||
"(currently %d).\n"
|
||||
"The PostgreSQL documentation contains more information about "
|
||||
"The PostgreSQL documentation contains more information about "
|
||||
"configuring your system for PostgreSQL.",
|
||||
MaxBackends) : 0));
|
||||
}
|
||||
@@ -149,7 +149,7 @@ IpcSemaphoreInitialize(IpcSemaphoreId semId, int semNum, int value)
|
||||
semId, semNum, value),
|
||||
(errno == ERANGE) ?
|
||||
errhint("You possibly need to raise your kernel's SEMVMX value to be at least "
|
||||
"%d. Look into the PostgreSQL documentation for details.",
|
||||
"%d. Look into the PostgreSQL documentation for details.",
|
||||
value) : 0));
|
||||
}
|
||||
|
||||
|
@@ -10,7 +10,7 @@
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/port/sysv_shmem.c,v 1.13 2003/07/27 21:49:54 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/port/sysv_shmem.c,v 1.14 2003/08/04 00:43:21 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -40,13 +40,13 @@ typedef int IpcMemoryId; /* shared memory ID returned by shmget(2) */
|
||||
|
||||
|
||||
IpcMemoryKey UsedShmemSegID = 0;
|
||||
void *UsedShmemSegAddr = NULL;
|
||||
void *UsedShmemSegAddr = NULL;
|
||||
|
||||
static void *InternalIpcMemoryCreate(IpcMemoryKey memKey, uint32 size);
|
||||
static void IpcMemoryDetach(int status, Datum shmaddr);
|
||||
static void IpcMemoryDelete(int status, Datum shmId);
|
||||
static PGShmemHeader *PGSharedMemoryAttach(IpcMemoryKey key,
|
||||
IpcMemoryId *shmid);
|
||||
IpcMemoryId *shmid);
|
||||
|
||||
|
||||
/*
|
||||
@@ -90,15 +90,15 @@ InternalIpcMemoryCreate(IpcMemoryKey memKey, uint32 size)
|
||||
*/
|
||||
ereport(FATAL,
|
||||
(errmsg("could not create shared memory segment: %m"),
|
||||
errdetail("Failed syscall was shmget(key=%d, size=%u, 0%o).",
|
||||
(int) memKey, size,
|
||||
IPC_CREAT | IPC_EXCL | IPCProtection),
|
||||
errdetail("Failed syscall was shmget(key=%d, size=%u, 0%o).",
|
||||
(int) memKey, size,
|
||||
IPC_CREAT | IPC_EXCL | IPCProtection),
|
||||
(errno == EINVAL) ?
|
||||
errhint("This error usually means that PostgreSQL's request for a shared memory "
|
||||
"segment exceeded your kernel's SHMMAX parameter. You can either "
|
||||
"reduce the request size or reconfigure the kernel with larger SHMMAX. "
|
||||
"To reduce the request size (currently %u bytes), reduce "
|
||||
"PostgreSQL's shared_buffers parameter (currently %d) and/or "
|
||||
"To reduce the request size (currently %u bytes), reduce "
|
||||
"PostgreSQL's shared_buffers parameter (currently %d) and/or "
|
||||
"its max_connections parameter (currently %d).\n"
|
||||
"If the request size is already small, it's possible that it is less than "
|
||||
"your kernel's SHMMIN parameter, in which case raising the request size or "
|
||||
@@ -108,9 +108,9 @@ InternalIpcMemoryCreate(IpcMemoryKey memKey, uint32 size)
|
||||
size, NBuffers, MaxBackends) : 0,
|
||||
(errno == ENOMEM) ?
|
||||
errhint("This error usually means that PostgreSQL's request for a shared "
|
||||
"memory segment exceeded available memory or swap space. "
|
||||
"To reduce the request size (currently %u bytes), reduce "
|
||||
"PostgreSQL's shared_buffers parameter (currently %d) and/or "
|
||||
"memory segment exceeded available memory or swap space. "
|
||||
"To reduce the request size (currently %u bytes), reduce "
|
||||
"PostgreSQL's shared_buffers parameter (currently %d) and/or "
|
||||
"its max_connections parameter (currently %d).\n"
|
||||
"The PostgreSQL documentation contains more information about shared "
|
||||
"memory configuration.",
|
||||
@@ -120,9 +120,9 @@ InternalIpcMemoryCreate(IpcMemoryKey memKey, uint32 size)
|
||||
"It occurs either if all available shared memory IDs have been taken, "
|
||||
"in which case you need to raise the SHMMNI parameter in your kernel, "
|
||||
"or because the system's overall limit for shared memory has been "
|
||||
"reached. If you cannot increase the shared memory limit, "
|
||||
"reduce PostgreSQL's shared memory request (currently %u bytes), "
|
||||
"by reducing its shared_buffers parameter (currently %d) and/or "
|
||||
"reached. If you cannot increase the shared memory limit, "
|
||||
"reduce PostgreSQL's shared memory request (currently %u bytes), "
|
||||
"by reducing its shared_buffers parameter (currently %d) and/or "
|
||||
"its max_connections parameter (currently %d).\n"
|
||||
"The PostgreSQL documentation contains more information about shared "
|
||||
"memory configuration.",
|
||||
@@ -326,13 +326,13 @@ PGSharedMemoryCreate(uint32 size, bool makePrivate, int port)
|
||||
hdr->totalsize = size;
|
||||
hdr->freeoffset = MAXALIGN(sizeof(PGShmemHeader));
|
||||
|
||||
|
||||
|
||||
if (ExecBackend && UsedShmemSegAddr == NULL && !makePrivate)
|
||||
{
|
||||
UsedShmemSegAddr = memAddress;
|
||||
UsedShmemSegID = NextShmemSegID;
|
||||
}
|
||||
|
||||
|
||||
return hdr;
|
||||
}
|
||||
|
||||
@@ -353,7 +353,7 @@ PGSharedMemoryAttach(IpcMemoryKey key, IpcMemoryId *shmid)
|
||||
hdr = (PGShmemHeader *) shmat(*shmid,
|
||||
UsedShmemSegAddr,
|
||||
#if defined(solaris) && defined(__sparc__)
|
||||
/* use intimate shared memory on Solaris */
|
||||
/* use intimate shared memory on Solaris */
|
||||
SHM_SHARE_MMU
|
||||
#else
|
||||
0
|
||||
|
@@ -17,9 +17,9 @@ typedef struct
|
||||
{
|
||||
int m_numSems;
|
||||
off_t m_semaphoreHandles;
|
||||
//offset from beginning of header
|
||||
/* offset from beginning of header */
|
||||
off_t m_semaphoreCounts;
|
||||
//offset from beginning of header
|
||||
/* offset from beginning of header */
|
||||
} win32_sem_set_hdr;
|
||||
|
||||
/* Control of a semaphore pool. The pool is an area in which we stored all
|
||||
@@ -131,7 +131,7 @@ semget(int semKey, int semNum, int flags)
|
||||
HANDLE *sem_handles = NULL;
|
||||
int *sem_counts = NULL;
|
||||
int i;
|
||||
|
||||
|
||||
sec_attrs.nLength = sizeof(sec_attrs);
|
||||
sec_attrs.lpSecurityDescriptor = NULL;
|
||||
sec_attrs.bInheritHandle = TRUE;
|
||||
@@ -152,8 +152,8 @@ semget(int semKey, int semNum, int flags)
|
||||
|
||||
new_set->m_numSems = semNum;
|
||||
new_set->m_semaphoreHandles = sizeof(win32_sem_set_hdr);
|
||||
//array starts after header
|
||||
new_set->m_semaphoreCounts = new_set->m_semaphoreHandles + (sizeof(HANDLE) * semNum);
|
||||
/* array starts after header */
|
||||
new_set->m_semaphoreCounts = new_set->m_semaphoreHandles + (sizeof(HANDLE) * semNum);
|
||||
|
||||
sem_handles = (HANDLE *) ((off_t) new_set + new_set->m_semaphoreHandles);
|
||||
sem_counts = (int *) ((off_t) new_set + new_set->m_semaphoreCounts);
|
||||
@@ -186,7 +186,8 @@ semget(int semKey, int semNum, int flags)
|
||||
return MAKE_OFFSET(new_set);
|
||||
else
|
||||
{
|
||||
int i;
|
||||
int i;
|
||||
|
||||
/* Blow away what we've got right now... */
|
||||
for (i = 0; i < semNum; ++i)
|
||||
{
|
||||
|
Reference in New Issue
Block a user