mirror of
https://github.com/postgres/postgres.git
synced 2025-11-10 17:42:29 +03:00
Fix indenting for 'extern "C"' cases.
This commit is contained in:
@@ -6,22 +6,22 @@
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
@@ -35,7 +35,7 @@
|
||||
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
static char sccsid[] = "@(#)system.c 8.1 (Berkeley) 6/4/93";
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/wait.h>
|
||||
@@ -46,51 +46,57 @@ static char sccsid[] = "@(#)system.c 8.1 (Berkeley) 6/4/93";
|
||||
#include <paths.h>
|
||||
#include <errno.h>
|
||||
|
||||
int system(const char *command);
|
||||
int system(const char *command);
|
||||
|
||||
int
|
||||
system(const char *command)
|
||||
{
|
||||
pid_t pid;
|
||||
int pstat;
|
||||
struct sigaction ign, intact, quitact;
|
||||
sigset_t newsigblock, oldsigblock;
|
||||
pid_t pid;
|
||||
int pstat;
|
||||
struct sigaction ign,
|
||||
intact,
|
||||
quitact;
|
||||
sigset_t newsigblock,
|
||||
oldsigblock;
|
||||
|
||||
if (!command) /* just checking... */
|
||||
return(1);
|
||||
if (!command) /* just checking... */
|
||||
return (1);
|
||||
|
||||
/*
|
||||
* Ignore SIGINT and SIGQUIT, block SIGCHLD. Remember to save
|
||||
* existing signal dispositions.
|
||||
* Ignore SIGINT and SIGQUIT, block SIGCHLD. Remember to save existing
|
||||
* signal dispositions.
|
||||
*/
|
||||
ign.sa_handler = SIG_IGN;
|
||||
(void)sigemptyset(&ign.sa_mask);
|
||||
(void) sigemptyset(&ign.sa_mask);
|
||||
ign.sa_flags = 0;
|
||||
(void)sigaction(SIGINT, &ign, &intact);
|
||||
(void)sigaction(SIGQUIT, &ign, &quitact);
|
||||
(void)sigemptyset(&newsigblock);
|
||||
(void)sigaddset(&newsigblock, SIGCHLD);
|
||||
(void)sigprocmask(SIG_BLOCK, &newsigblock, &oldsigblock);
|
||||
switch(pid = fork()) {
|
||||
case -1: /* error */
|
||||
break;
|
||||
case 0: /* child */
|
||||
/*
|
||||
* Restore original signal dispositions and exec the command.
|
||||
*/
|
||||
(void)sigaction(SIGINT, &intact, NULL);
|
||||
(void)sigaction(SIGQUIT, &quitact, NULL);
|
||||
(void)sigprocmask(SIG_SETMASK, &oldsigblock, NULL);
|
||||
execl(_PATH_BSHELL, "sh", "-c", command, (char *)NULL);
|
||||
_exit(127);
|
||||
default: /* parent */
|
||||
do {
|
||||
pid = wait4(pid, &pstat, 0, (struct rusage *)0);
|
||||
} while (pid == -1 && errno == EINTR);
|
||||
break;
|
||||
(void) sigaction(SIGINT, &ign, &intact);
|
||||
(void) sigaction(SIGQUIT, &ign, &quitact);
|
||||
(void) sigemptyset(&newsigblock);
|
||||
(void) sigaddset(&newsigblock, SIGCHLD);
|
||||
(void) sigprocmask(SIG_BLOCK, &newsigblock, &oldsigblock);
|
||||
switch (pid = fork())
|
||||
{
|
||||
case -1: /* error */
|
||||
break;
|
||||
case 0: /* child */
|
||||
|
||||
/*
|
||||
* Restore original signal dispositions and exec the command.
|
||||
*/
|
||||
(void) sigaction(SIGINT, &intact, NULL);
|
||||
(void) sigaction(SIGQUIT, &quitact, NULL);
|
||||
(void) sigprocmask(SIG_SETMASK, &oldsigblock, NULL);
|
||||
execl(_PATH_BSHELL, "sh", "-c", command, (char *) NULL);
|
||||
_exit(127);
|
||||
default: /* parent */
|
||||
do
|
||||
{
|
||||
pid = wait4(pid, &pstat, 0, (struct rusage *) 0);
|
||||
} while (pid == -1 && errno == EINTR);
|
||||
break;
|
||||
}
|
||||
(void)sigaction(SIGINT, &intact, NULL);
|
||||
(void)sigaction(SIGQUIT, &quitact, NULL);
|
||||
(void)sigprocmask(SIG_SETMASK, &oldsigblock, NULL);
|
||||
return(pid == -1 ? -1 : pstat);
|
||||
(void) sigaction(SIGINT, &intact, NULL);
|
||||
(void) sigaction(SIGQUIT, &quitact, NULL);
|
||||
(void) sigprocmask(SIG_SETMASK, &oldsigblock, NULL);
|
||||
return (pid == -1 ? -1 : pstat);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: aix.h,v 1.9 2001/11/05 17:46:27 momjian Exp $
|
||||
* $Id: aix.h,v 1.10 2001/11/08 20:37:52 momjian Exp $
|
||||
*
|
||||
* @(#)dlfcn.h 1.4 revision of 95/04/25 09:36:52
|
||||
* This is an unpublished work copyright (c) 1992 HELIOS Software GmbH
|
||||
@@ -31,23 +31,23 @@ extern "C"
|
||||
* To be able to intialize, a library may provide a dl_info structure
|
||||
* that contains functions to be called to initialize and terminate.
|
||||
*/
|
||||
struct dl_info
|
||||
{
|
||||
void (*init) (void);
|
||||
void (*fini) (void);
|
||||
};
|
||||
struct dl_info
|
||||
{
|
||||
void (*init) (void);
|
||||
void (*fini) (void);
|
||||
};
|
||||
|
||||
#if __STDC__ || defined(_IBMR2)
|
||||
void *dlopen(const char *path, int mode);
|
||||
void *dlsym(void *handle, const char *symbol);
|
||||
char *dlerror(void);
|
||||
int dlclose(void *handle);
|
||||
void *dlopen(const char *path, int mode);
|
||||
void *dlsym(void *handle, const char *symbol);
|
||||
char *dlerror(void);
|
||||
int dlclose(void *handle);
|
||||
|
||||
#else
|
||||
void *dlopen();
|
||||
void *dlsym();
|
||||
char *dlerror();
|
||||
int dlclose();
|
||||
void *dlopen();
|
||||
void *dlsym();
|
||||
char *dlerror();
|
||||
int dlclose();
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/port/qnx4/Attic/sem.h,v 1.6 2001/11/05 17:46:27 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/port/qnx4/Attic/sem.h,v 1.7 2001/11/08 20:37:52 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -38,28 +38,28 @@ extern "C"
|
||||
* There is one semaphore structure for each semaphore in the system.
|
||||
*/
|
||||
|
||||
struct sem
|
||||
{
|
||||
ushort_t semval; /* semaphore text map address */
|
||||
pid_t sempid; /* pid of last operation */
|
||||
ushort_t semncnt; /* # awaiting semval > cval */
|
||||
ushort_t semzcnt; /* # awaiting semval = 0 */
|
||||
};
|
||||
struct sem
|
||||
{
|
||||
ushort_t semval; /* semaphore text map address */
|
||||
pid_t sempid; /* pid of last operation */
|
||||
ushort_t semncnt; /* # awaiting semval > cval */
|
||||
ushort_t semzcnt; /* # awaiting semval = 0 */
|
||||
};
|
||||
|
||||
/*
|
||||
* User semaphore template for semop system calls.
|
||||
*/
|
||||
|
||||
struct sembuf
|
||||
{
|
||||
ushort_t sem_num; /* semaphore # */
|
||||
short sem_op; /* semaphore operation */
|
||||
short sem_flg; /* operation flags */
|
||||
};
|
||||
struct sembuf
|
||||
{
|
||||
ushort_t sem_num; /* semaphore # */
|
||||
short sem_op; /* semaphore operation */
|
||||
short sem_flg; /* operation flags */
|
||||
};
|
||||
|
||||
extern int semctl(int semid, int semnum, int cmd, /* ... */ union semun arg);
|
||||
extern int semget(key_t key, int nsems, int semflg);
|
||||
extern int semop(int semid, struct sembuf * sops, size_t nsops);
|
||||
extern int semctl(int semid, int semnum, int cmd, /* ... */ union semun arg);
|
||||
extern int semget(key_t key, int nsems, int semflg);
|
||||
extern int semop(int semid, struct sembuf * sops, size_t nsops);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/port/qnx4/Attic/shm.h,v 1.6 2001/11/05 17:46:27 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/port/qnx4/Attic/shm.h,v 1.7 2001/11/08 20:37:52 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -25,16 +25,16 @@ extern "C"
|
||||
#define SHM_R 0400 /* read permission */
|
||||
#define SHM_W 0200 /* write permission */
|
||||
|
||||
struct shmid_ds
|
||||
{
|
||||
int dummy;
|
||||
int shm_nattch;
|
||||
};
|
||||
struct shmid_ds
|
||||
{
|
||||
int dummy;
|
||||
int shm_nattch;
|
||||
};
|
||||
|
||||
extern void *shmat(int shmid, const void *shmaddr, int shmflg);
|
||||
extern int shmdt(const void *addr);
|
||||
extern int shmctl(int shmid, int cmd, struct shmid_ds * buf);
|
||||
extern int shmget(key_t key, size_t size, int flags);
|
||||
extern void *shmat(int shmid, const void *shmaddr, int shmflg);
|
||||
extern int shmdt(const void *addr);
|
||||
extern int shmctl(int shmid, int cmd, struct shmid_ds * buf);
|
||||
extern int shmget(key_t key, size_t size, int flags);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.115 2001/11/06 00:38:26 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.116 2001/11/08 20:37:52 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -125,7 +125,7 @@ InitProcGlobal(int maxBackends)
|
||||
/*
|
||||
* Compute size for ProcGlobal structure. Note we need one more sema
|
||||
* besides those used for regular backends; this is accounted for in
|
||||
* the PROC_SEM_MAP_ENTRIES macro. (We do it that way so that other
|
||||
* the PROC_SEM_MAP_ENTRIES macro. (We do it that way so that other
|
||||
* modules that use PROC_SEM_MAP_ENTRIES(maxBackends) to size data
|
||||
* structures don't have to know about this explicitly.)
|
||||
*/
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $Id: tgRecipe.h,v 1.21 2001/11/05 17:46:28 momjian Exp $
|
||||
* $Id: tgRecipe.h,v 1.22 2001/11/08 20:37:52 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -29,6 +29,7 @@ typedef struct
|
||||
y;
|
||||
} Point; /* this should match whatever is in
|
||||
|
||||
*
|
||||
*
|
||||
*
|
||||
* geo-decls.h */
|
||||
|
||||
Reference in New Issue
Block a user