1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-12 05:01:15 +03:00

Remove fork()/exec() and only do fork(). Small cleanups.

This commit is contained in:
Bruce Momjian
1998-05-29 17:00:34 +00:00
parent 2d4c6cab96
commit 212c905e2c
19 changed files with 172 additions and 144 deletions

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/storage/ipc/ipc.c,v 1.20 1998/03/02 05:41:55 scrappy Exp $
* $Header: /cvsroot/pgsql/src/backend/storage/ipc/ipc.c,v 1.21 1998/05/29 17:00:10 momjian Exp $
*
* NOTES
*
@@ -137,7 +137,6 @@ exitpg(int code)
for (i = onexit_index - 1; i >= 0; --i)
(*onexit_list[i].function) (code, onexit_list[i].arg);
StreamDoUnlink();
exit(code);
}
@@ -168,7 +167,9 @@ quasi_exitpg()
* ----------------
*/
for (i = onexit_index - 1; i >= 0; --i)
(*onexit_list[i].function) (0, onexit_list[i].arg);
/* Don't do StreamDoUnlink on quasi_exit */
if (onexit_list[i].function != StreamDoUnlink)
(*onexit_list[i].function) (0, onexit_list[i].arg);
onexit_index = 0;
exitpg_inprogress = 0;
@@ -182,7 +183,7 @@ quasi_exitpg()
* ----------------------------------------------------------------
*/
int
on_exitpg(void (*function) (), caddr_t arg)
on_exitpg(void (*function) (), caddr_t arg)
{
if (onexit_index >= MAX_ON_EXITS)
return (-1);
@@ -195,6 +196,18 @@ int
return (0);
}
/* ----------------------------------------------------------------
* clear_exitpg
*
* this function clears all exitpg() registered functions.
* ----------------------------------------------------------------
*/
void
clear_exitpg(void)
{
onexit_index = 0;
}
/****************************************************************************/
/* IPCPrivateSemaphoreKill(status, semId) */
/* */

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/storage/ipc/ipci.c,v 1.7 1997/09/08 02:28:48 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/storage/ipc/ipci.c,v 1.8 1998/05/29 17:00:12 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -101,7 +101,7 @@ CreateSharedMemoryAndSemaphores(IPCKey key)
* ----------------
*/
InitProcGlobal(key);
on_exitpg(ProcFreeAllSemaphores, 0);
on_exitpg(ProcFreeAllSemaphores, NULL);
CreateSharedInvalidationState(key);
}

View File

@@ -10,7 +10,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/storage/smgr/Attic/mm.c,v 1.7 1997/09/18 20:21:53 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/storage/smgr/Attic/mm.c,v 1.8 1998/05/29 17:00:13 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -79,7 +79,6 @@ typedef struct MMRelHashEntry
#define MMNRELATIONS 2
SPINLOCK MMCacheLock;
extern bool IsPostmaster;
extern Oid MyDatabaseId;
static int *MMCurTop;
@@ -139,7 +138,7 @@ mminit()
return (SM_FAIL);
}
if (IsPostmaster)
if (IsUnderPostmaster) /* was IsPostmaster bjm */
{
MemSet(mmcacheblk, 0, mmsize);
SpinRelease(MMCacheLock);

View File

@@ -10,7 +10,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/storage/smgr/smgr.c,v 1.14 1998/04/01 15:35:33 scrappy Exp $
* $Header: /cvsroot/pgsql/src/backend/storage/smgr/smgr.c,v 1.15 1998/05/29 17:00:14 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -100,7 +100,7 @@ smgrinit()
}
/* register the shutdown proc */
on_exitpg(smgrshutdown, 0);
on_exitpg(smgrshutdown, NULL);
return (SM_SUCCESS);
}