]> granicus.if.org Git - postgresql/commitdiff
The remainder of D'Arcy's changes, most notibly the usage of SIGNAL_ARGS
authorMarc G. Fournier <scrappy@hub.org>
Fri, 4 Oct 1996 20:17:11 +0000 (20:17 +0000)
committerMarc G. Fournier <scrappy@hub.org>
Fri, 4 Oct 1996 20:17:11 +0000 (20:17 +0000)
src/backend/postmaster/postmaster.c
src/backend/tcop/postgres.c
src/include/commands/async.h
src/mk/postgres.mk

index 7de3703797be82d8a168b862e06430105d179342..55c7fe8109c5d5e1fb602f0b8daaf900179f0e05 100644 (file)
@@ -10,7 +10,7 @@
  *
  *
  * IDENTIFICATION
- *    $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.8 1996/09/26 03:17:44 momjian Exp $
+ *    $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.9 1996/10/04 20:16:18 scrappy Exp $
  *
  * NOTES
  *
@@ -156,20 +156,14 @@ static void pmdaemonize(void);
 static int ConnStartup(Port *port);
 static int ConnCreate(int serverFd, int *newFdP);
 static void reset_shared(short port);
-#if defined(linux)
-static void pmdie(int);
-static void reaper(int);
-static void dumpstatus(int);
-#else
-static void pmdie(void);
-static void reaper(void);
-static void dumpstatus();
-#endif
+static void pmdie(SIGNAL_ARGS);
+static void reaper(SIGNAL_ARGS);
+static void dumpstatus(SIGNAL_ARGS);
 static void CleanupProc(int pid, int exitstatus);
 static int DoExec(StartupInfo *packet, int portFd);
 static void ExitPostmaster(int status);
-static void usage();
-static void checkDataDir();
+static void usage(const char *);
+static void checkDataDir(void);
 
 int ServerLoop(void);
 int BackendStartup(StartupInfo *packet, Port *port, int *pidPtr);
@@ -367,7 +361,7 @@ PostmasterMain(int argc, char *argv[])
 }
 
 static void
-pmdaemonize()
+pmdaemonize(void)
 {
     int i;
     
@@ -387,7 +381,7 @@ pmdaemonize()
 }
 
 static void
-usage(char *progname)
+usage(const char *progname)
 {
     fprintf(stderr, "usage: %s [options..]\n", progname);
     fprintf(stderr, "\t-a authsys\tdo/do not permit use of an authentication system\n");
@@ -405,7 +399,7 @@ usage(char *progname)
 }
 
 int
-ServerLoop()
+ServerLoop(void)
 {
     int                serverFd = ServerSock;
     fd_set     rmask, basemask;
@@ -435,7 +429,7 @@ ServerLoop()
            fprintf(stderr, "%s: ServerLoop: select failed\n",
                    progname);
            return(STATUS_ERROR);
-       }
+        }
        /* [TRH]
         * To avoid race conditions, block SIGCHLD signals while we are
         * handling the request. (both reaper() and ConnCreate()
@@ -468,7 +462,7 @@ ServerLoop()
            --nSelected;
            FD_CLR(ServerSock, &rmask);
          }
-
+     
        if (DebugLvl > 1) {
            fprintf(stderr, "%s: ServerLoop:\tnSelected=%d\n",
                    progname, nSelected);
@@ -661,11 +655,7 @@ reset_shared(short port)
  * pmdie -- signal handler for cleaning up after a kill signal.
  */
 static void
-#if defined(PORTNAME_linux)
-pmdie(int i)
-#else
-pmdie()
-#endif
+pmdie(SIGNAL_ARGS)
 {
     exitpg(0);
 }
@@ -674,11 +664,7 @@ pmdie()
  * Reaper -- signal handler to cleanup after a backend (child) dies.
  */
 static void
-#if defined(PORTNAME_linux)
-reaper(int i)
-#else
-reaper()
-#endif
+reaper(SIGNAL_ARGS)
 {
     int        status;         /* backend exit status */
     int        pid;            /* process id of dead backend */
@@ -1083,11 +1069,7 @@ ExitPostmaster(int status)
 }
 
 static void
-#if defined(PORTNAME_linux)
-dumpstatus(int i)
-#else
-dumpstatus()
-#endif
+dumpstatus(SIGNAL_ARGS)
 {
     Dlelem *curr = DLGetHead(PortList); 
     
@@ -1104,7 +1086,7 @@ dumpstatus()
 }
 
 static void
-checkDataDir()
+checkDataDir(void)
 {
     char path[MAXPATHLEN];
     FILE *fp;
index 43fb9003c7f0581596dd7fa7599d8855b1271088..dd638c03c7267b0986964cccd9880ea35dc1d6b9 100644 (file)
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *    $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.8 1996/09/16 05:36:38 scrappy Exp $
+ *    $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.9 1996/10/04 20:16:32 scrappy Exp $
  *
  * NOTES
  *    this is the "main" module of the postgres backend and
@@ -707,13 +707,13 @@ pg_eval_dest(char *query_string, /* string to execute */
  */
 
 void
-handle_warn()
+handle_warn(SIGNAL_ARGS)
 {
     siglongjmp(Warn_restart, 1);
 }
 
 void
-quickdie()
+quickdie(SIGNAL_ARGS)
 {
     elog(NOTICE, "I have been signalled by the postmaster.");
     elog(NOTICE, "Some backend process has died unexpectedly and possibly");
@@ -731,14 +731,14 @@ quickdie()
 }
 
 void
-die()
+die(SIGNAL_ARGS)
 {
     ExitPostgres(0);
 }
 
 /* signal handler for floating point exception */
 void
-FloatExceptionHandler()
+FloatExceptionHandler(SIGNAL_ARGS)
 {
    elog(WARN, "floating point exception! the last floating point operation eit\
 her exceeded legal ranges or was a divide by zero");
@@ -1269,7 +1269,7 @@ PostgresMain(int argc, char *argv[])
      */
     if (IsUnderPostmaster == false) {
        puts("\nPOSTGRES backend interactive interface");
-       puts("$Revision: 1.8 $ $Date: 1996/09/16 05:36:38 $");
+       puts("$Revision: 1.9 $ $Date: 1996/10/04 20:16:32 $");
     }
     
     /* ----------------
index c55cff2be8a2ccfd144cbc8fcdac9656850771d6..bb500942e38b55f823c82ac02bc87f2a939501d2 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Copyright (c) 1994, Regents of the University of California
  *
- * $Id: async.h,v 1.1 1996/08/28 07:21:41 scrappy Exp $
+ * $Id: async.h,v 1.2 1996/10/04 20:16:52 scrappy Exp $
  *
  *-------------------------------------------------------------------------
  */
 
 #include "nodes/memnodes.h"
 
-#if defined(PORTNAME_linux)
-extern void Async_NotifyHandler(int);
-#else
-extern void Async_NotifyHandler(void);
-#endif
+extern void Async_NotifyHandler(SIGNAL_ARGS);
 extern void Async_Notify(char *relname);
 extern void Async_NotifyAtCommit(void);
 extern void Async_NotifyAtAbort(void);
index a925e07d839797a847e0b29169bd7bdb74181f0f..06ac466f50b8412b7533fb4eca5ad91639249a6a 100644 (file)
@@ -9,7 +9,7 @@
 #
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/mk/Attic/postgres.mk,v 1.3 1996/09/23 08:24:11 scrappy Exp $
+#    $Header: /cvsroot/pgsql/src/mk/Attic/postgres.mk,v 1.4 1996/10/04 20:17:11 scrappy Exp $
 #
 #-------------------------------------------------------------------------
 
@@ -89,6 +89,18 @@ endef
 include $(MKDIR)/../Makefile.global
 -include $(MKDIR)/port/postgres.mk.$(PORTNAME)
 
+# The following is used as the arg list for signal handlers.  Any ports
+# that take something other than an int argument should change this in
+# the port specific makefile.  Note that variable names are required
+# because it is used in both the prototypes as well as the definitions.
+# Note also the long name.  We expect that this won't collide with
+# other names causing compiler warnings.
+#ifndef       SIGNAL_ARGS
+#define SIGNAL_ARGS int postgres_signal_arg
+#endif
+
+CFLAGS +=     -DSIGNAL_ARGS=$(SIGNAL_ARGS)
+
 CURDIR:= $(shell pwd)
 
 # This is where we put all the .o's and the generated files.