This patch properly sets the prototype for the on_shmem_exit and
on_proc_exit functions, and adjust all other related code to use
the proper types too.



Kurt

Index: src/backend/access/transam/xlog.c
===================================================================
RCS file: /projects/cvsroot/pgsql-server/src/backend/access/transam/xlog.c,v
retrieving revision 1.126
diff -u -r1.126 xlog.c
--- src/backend/access/transam/xlog.c   29 Nov 2003 19:51:40 -0000      1.126
+++ src/backend/access/transam/xlog.c   9 Dec 2003 21:08:37 -0000
@@ -3086,7 +3086,7 @@
  * This must be called ONCE during postmaster or standalone-backend shutdown
  */
 void
-ShutdownXLOG(void)
+ShutdownXLOG(int code, Datum arg)
 {
        ereport(LOG,
                        (errmsg("shutting down")));
Index: src/backend/bootstrap/bootstrap.c
===================================================================
RCS file: /projects/cvsroot/pgsql-server/src/backend/bootstrap/bootstrap.c,v
retrieving revision 1.169
diff -u -r1.169 bootstrap.c
--- src/backend/bootstrap/bootstrap.c   1 Dec 2003 22:15:37 -0000       1.169
+++ src/backend/bootstrap/bootstrap.c   9 Dec 2003 21:08:38 -0000
@@ -478,8 +478,8 @@
                        proc_exit(0);           /* done */
 
                case BS_XLOG_SHUTDOWN:
-                       ShutdownXLOG();
-                       DumpFreeSpaceMap();
+                       ShutdownXLOG(0, 0);
+                       DumpFreeSpaceMap(0, 0);
                        proc_exit(0);           /* done */
 
                default:
Index: src/backend/catalog/namespace.c
===================================================================
RCS file: /projects/cvsroot/pgsql-server/src/backend/catalog/namespace.c,v
retrieving revision 1.59
diff -u -r1.59 namespace.c
--- src/backend/catalog/namespace.c     29 Nov 2003 19:51:45 -0000      1.59
+++ src/backend/catalog/namespace.c     9 Dec 2003 21:08:39 -0000
@@ -130,7 +130,7 @@
 static void recomputeNamespacePath(void);
 static void InitTempTableNamespace(void);
 static void RemoveTempRelations(Oid tempNamespaceId);
-static void RemoveTempRelationsCallback(void);
+static void RemoveTempRelationsCallback(int code, Datum arg);
 static void NamespaceCallback(Datum arg, Oid relid);
 
 /* These don't really need to appear in any header file */
@@ -1735,7 +1735,7 @@
  * Callback to remove temp relations at backend exit.
  */
 static void
-RemoveTempRelationsCallback(void)
+RemoveTempRelationsCallback(int code, Datum arg)
 {
        if (OidIsValid(myTempNamespace))        /* should always be true */
        {
Index: src/backend/commands/async.c
===================================================================
RCS file: /projects/cvsroot/pgsql-server/src/backend/commands/async.c,v
retrieving revision 1.105
diff -u -r1.105 async.c
--- src/backend/commands/async.c        29 Nov 2003 19:51:47 -0000      1.105
+++ src/backend/commands/async.c        9 Dec 2003 21:08:39 -0000
@@ -120,7 +120,7 @@
 
 
 static void Async_UnlistenAll(void);
-static void Async_UnlistenOnExit(void);
+static void Async_UnlistenOnExit(int code, Datum arg);
 static void ProcessIncomingNotify(void);
 static void NotifyMyFrontEnd(char *relname, int32 listenerPID);
 static bool AsyncExistsPendingNotify(const char *relname);
@@ -384,7 +384,7 @@
  *--------------------------------------------------------------
  */
 static void
-Async_UnlistenOnExit(void)
+Async_UnlistenOnExit(int code, Datum arg)
 {
        /*
         * We need to start/commit a transaction for the unlisten, but if
Index: src/backend/libpq/pqcomm.c
===================================================================
RCS file: /projects/cvsroot/pgsql-server/src/backend/libpq/pqcomm.c,v
retrieving revision 1.167
diff -u -r1.167 pqcomm.c
--- src/backend/libpq/pqcomm.c  29 Nov 2003 19:51:49 -0000      1.167
+++ src/backend/libpq/pqcomm.c  9 Dec 2003 21:08:40 -0000
@@ -88,7 +88,7 @@
 #include "storage/ipc.h"
 
 
-static void pq_close(void);
+static void pq_close(int code, Datum arg);
 
 #ifdef HAVE_UNIX_SOCKETS
 static int     Lock_AF_UNIX(unsigned short portNumber, char *unixSocketName);
@@ -145,7 +145,7 @@
  * --------------------------------
  */
 static void
-pq_close(void)
+pq_close(int code, Datum arg)
 {
        if (MyProcPort != NULL)
        {
@@ -183,7 +183,7 @@
  */
 #ifdef HAVE_UNIX_SOCKETS
 static void
-StreamDoUnlink(void)
+StreamDoUnlink(int code, Datum arg)
 {
        Assert(sock_path[0]);
        unlink(sock_path);
Index: src/backend/port/ipc_test.c
===================================================================
RCS file: /projects/cvsroot/pgsql-server/src/backend/port/ipc_test.c,v
retrieving revision 1.11
diff -u -r1.11 ipc_test.c
--- src/backend/port/ipc_test.c 29 Nov 2003 19:51:54 -0000      1.11
+++ src/backend/port/ipc_test.c 9 Dec 2003 21:08:40 -0000
@@ -62,7 +62,7 @@
 
 static struct ONEXIT
 {
-       void            (*function) ();
+       void            (*function) (int code, Datum arg);
        Datum           arg;
 }      on_proc_exit_list[MAX_ON_EXITS], on_shmem_exit_list[MAX_ON_EXITS];
 
@@ -89,7 +89,7 @@
 }
 
 void
-                       on_shmem_exit(void (*function) (), Datum arg)
+on_shmem_exit(void (*function) (int code, Datum arg), Datum arg)
 {
        if (on_shmem_exit_index >= MAX_ON_EXITS)
                elog(FATAL, "out of on_shmem_exit slots");
Index: src/backend/storage/file/fd.c
===================================================================
RCS file: /projects/cvsroot/pgsql-server/src/backend/storage/file/fd.c,v
retrieving revision 1.103
diff -u -r1.103 fd.c
--- src/backend/storage/file/fd.c       29 Nov 2003 19:51:56 -0000      1.103
+++ src/backend/storage/file/fd.c       9 Dec 2003 21:08:41 -0000
@@ -205,7 +205,7 @@
 static File fileNameOpenFile(FileName fileName, int fileFlags, int fileMode);
 static char *filepath(const char *filename);
 static long pg_nofile(void);
-static void AtProcExit_Files(void);
+static void AtProcExit_Files(int code, Datum arg);
 static void CleanupTempFiles(bool isProcExit);
 
 
@@ -1141,7 +1141,7 @@
  * Here, we want to clean up *all* temp files including interXact ones.
  */
 static void
-AtProcExit_Files(void)
+AtProcExit_Files(int code, Datum arg)
 {
        CleanupTempFiles(true);
 }
Index: src/backend/storage/freespace/freespace.c
===================================================================
RCS file: /projects/cvsroot/pgsql-server/src/backend/storage/freespace/freespace.c,v
retrieving revision 1.26
diff -u -r1.26 freespace.c
--- src/backend/storage/freespace/freespace.c   29 Nov 2003 19:51:56 -0000      1.26
+++ src/backend/storage/freespace/freespace.c   9 Dec 2003 21:08:42 -0000
@@ -717,7 +717,7 @@
  * forma --- if anyone else is still accessing FSM, there's a problem.
  */
 void
-DumpFreeSpaceMap(void)
+DumpFreeSpaceMap(int code, Datum arg)
 {
        FILE       *fp;
        char            cachefilename[MAXPGPATH];
Index: src/backend/storage/ipc/ipc.c
===================================================================
RCS file: /projects/cvsroot/pgsql-server/src/backend/storage/ipc/ipc.c,v
retrieving revision 1.86
diff -u -r1.86 ipc.c
--- src/backend/storage/ipc/ipc.c       29 Nov 2003 19:51:56 -0000      1.86
+++ src/backend/storage/ipc/ipc.c       9 Dec 2003 21:08:42 -0000
@@ -53,7 +53,7 @@
 
 static struct ONEXIT
 {
-       void            (*function) ();
+       void            (*function) (int code, Datum arg);
        Datum           arg;
 }      on_proc_exit_list[MAX_ON_EXITS], on_shmem_exit_list[MAX_ON_EXITS];
 
@@ -146,7 +146,7 @@
  * ----------------------------------------------------------------
  */
 void
-                       on_proc_exit(void (*function) (), Datum arg)
+on_proc_exit(void (*function) (int code, Datum arg), Datum arg)
 {
        if (on_proc_exit_index >= MAX_ON_EXITS)
                ereport(FATAL,
@@ -167,7 +167,7 @@
  * ----------------------------------------------------------------
  */
 void
-                       on_shmem_exit(void (*function) (), Datum arg)
+on_shmem_exit(void (*function) (int code, Datum arg), Datum arg)
 {
        if (on_shmem_exit_index >= MAX_ON_EXITS)
                ereport(FATAL,
Index: src/backend/storage/lmgr/proc.c
===================================================================
RCS file: /projects/cvsroot/pgsql-server/src/backend/storage/lmgr/proc.c,v
retrieving revision 1.139
diff -u -r1.139 proc.c
--- src/backend/storage/lmgr/proc.c     1 Dec 2003 21:59:25 -0000       1.139
+++ src/backend/storage/lmgr/proc.c     9 Dec 2003 21:08:43 -0000
@@ -84,8 +84,8 @@
 static struct timeval statement_fin_time;
 
 
-static void ProcKill(void);
-static void DummyProcKill(void);
+static void ProcKill(int code, Datum arg);
+static void DummyProcKill(int code, Datum arg);
 static bool CheckStatementTimeout(void);
 
 
@@ -406,7 +406,7 @@
  *             this process. Release any of its held LW locks.
  */
 static void
-ProcKill(void)
+ProcKill(int code, Datum arg)
 {
        /* use volatile pointer to prevent code rearrangement */
        volatile PROC_HDR *procglobal = ProcGlobal;
@@ -455,7 +455,7 @@
  *             as not-in-use.
  */
 static void
-DummyProcKill(void)
+DummyProcKill(int code, Datum arg)
 {
        PGPROC  *dummyproc;
 
Index: src/backend/storage/smgr/smgr.c
===================================================================
RCS file: /projects/cvsroot/pgsql-server/src/backend/storage/smgr/smgr.c,v
retrieving revision 1.66
diff -u -r1.66 smgr.c
--- src/backend/storage/smgr/smgr.c     29 Nov 2003 19:51:57 -0000      1.66
+++ src/backend/storage/smgr/smgr.c     9 Dec 2003 21:08:43 -0000
@@ -24,7 +24,7 @@
 #include "utils/memutils.h"
 
 
-static void smgrshutdown(void);
+static void smgrshutdown(int code, Datum arg);
 
 typedef struct f_smgr
 {
@@ -142,7 +142,7 @@
 }
 
 static void
-smgrshutdown(void)
+smgrshutdown(int code, Datum arg)
 {
        int                     i;
 
Index: src/backend/utils/init/postinit.c
===================================================================
RCS file: /projects/cvsroot/pgsql-server/src/backend/utils/init/postinit.c,v
retrieving revision 1.130
diff -u -r1.130 postinit.c
--- src/backend/utils/init/postinit.c   29 Nov 2003 19:52:01 -0000      1.130
+++ src/backend/utils/init/postinit.c   9 Dec 2003 21:08:43 -0000
@@ -43,7 +43,7 @@
 
 static void ReverifyMyDatabase(const char *name);
 static void InitCommunication(void);
-static void ShutdownPostgres(void);
+static void ShutdownPostgres(int code, Datum arg);
 static bool ThereIsAtLeastOneUser(void);
 
 
@@ -453,7 +453,7 @@
  * cleanup fails.
  */
 static void
-ShutdownPostgres(void)
+ShutdownPostgres(int code, Datum arg)
 {
        /*
         * These operations are really just a minimal subset of
Index: src/include/access/xlog.h
===================================================================
RCS file: /projects/cvsroot/pgsql-server/src/include/access/xlog.h,v
retrieving revision 1.45
diff -u -r1.45 xlog.h
--- src/include/access/xlog.h   29 Nov 2003 22:40:55 -0000      1.45
+++ src/include/access/xlog.h   9 Dec 2003 21:08:44 -0000
@@ -207,7 +207,7 @@
 extern void XLOGPathInit(void);
 extern void BootStrapXLOG(void);
 extern void StartupXLOG(void);
-extern void ShutdownXLOG(void);
+extern void ShutdownXLOG(int code, Datum arg);
 extern void CreateCheckPoint(bool shutdown, bool force);
 extern void SetThisStartUpID(void);
 extern void XLogPutNextOid(Oid nextOid);
Index: src/include/storage/freespace.h
===================================================================
RCS file: /projects/cvsroot/pgsql-server/src/include/storage/freespace.h,v
retrieving revision 1.14
diff -u -r1.14 freespace.h
--- src/include/storage/freespace.h     29 Nov 2003 22:41:13 -0000      1.14
+++ src/include/storage/freespace.h     9 Dec 2003 21:08:44 -0000
@@ -60,7 +60,7 @@
 
 extern void PrintFreeSpaceMapStatistics(int elevel);
 
-extern void DumpFreeSpaceMap(void);
+extern void DumpFreeSpaceMap(int code, Datum arg);
 extern void LoadFreeSpaceMap(void);
 
 #ifdef FREESPACE_DEBUG
Index: src/include/storage/ipc.h
===================================================================
RCS file: /projects/cvsroot/pgsql-server/src/include/storage/ipc.h,v
retrieving revision 1.62
diff -u -r1.62 ipc.h
--- src/include/storage/ipc.h   29 Nov 2003 22:41:13 -0000      1.62
+++ src/include/storage/ipc.h   9 Dec 2003 21:08:44 -0000
@@ -24,8 +24,8 @@
 
 extern void proc_exit(int code);
 extern void shmem_exit(int code);
-extern void on_proc_exit(void (*function) (), Datum arg);
-extern void on_shmem_exit(void (*function) (), Datum arg);
+extern void on_proc_exit(void (*function) (int code, Datum arg), Datum arg);
+extern void on_shmem_exit(void (*function) (int code, Datum arg), Datum arg);
 extern void on_exit_reset(void);
 
 /* ipci.c */
---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

               http://www.postgresql.org/docs/faqs/FAQ.html

Reply via email to