Fix some compiler warnings.
authorTatsuo Ishii <ishii@postgresql.org>
Sun, 8 Oct 2017 06:57:08 +0000 (15:57 +0900)
committerTatsuo Ishii <ishii@postgresql.org>
Sun, 8 Oct 2017 06:57:08 +0000 (15:57 +0900)
src/context/pool_process_context.c
src/include/context/pool_process_context.h
src/include/pool.h
src/main/pgpool_main.c
src/main/pool_globals.c
src/utils/pcp/pcp_timeout.c
src/watchdog/wd_interlock.c
src/watchdog/wd_lifecheck.c

index ecfdae4918c17806a8154323c8c792931dcf5095..085b69c85b7773cd736998a4fbd63e8d5025f02a 100644 (file)
@@ -6,7 +6,7 @@
  * pgpool: a language independent connection pool server for PostgreSQL 
  * written by Tatsuo Ishii
  *
- * Copyright (c) 2003-2015     PgPool Global Development Group
+ * Copyright (c) 2003-2017     PgPool Global Development Group
  *
  * Permission to use, copy, modify, and distribute this software and
  * its documentation for any purpose and without fee is hereby
@@ -25,6 +25,7 @@
 #include "utils/elog.h"
 #include "context/pool_process_context.h"
 #include "pool_config.h"               /* remove me afterwards */
+#include <unistd.h>
 
 static POOL_PROCESS_CONTEXT process_context_d;
 static POOL_PROCESS_CONTEXT *process_context;
@@ -270,7 +271,7 @@ void pool_alarm(pool_sighandler_t handler, unsigned int second)
 /*
  * Undo the alarm signal handler using the remaining time.
  */
-void pool_undo_alarm()
+void pool_undo_alarm(void)
 {
        POOL_PROCESS_CONTEXT *p = pool_get_process_context();
 
index de9ed02b19221767d9ff42aa5c33d352fbb94fa6..69587954596b09f870b12c9ade6ffbba9e18f89d 100644 (file)
@@ -6,7 +6,7 @@
  * pgpool: a language independent connection pool server for PostgreSQL 
  * written by Tatsuo Ishii
  *
- * Copyright (c) 2003-2010     PgPool Global Development Group
+ * Copyright (c) 2003-2017     PgPool Global Development Group
  *
  * Permission to use, copy, modify, and distribute this software and
  * its documentation for any purpose and without fee is hereby
@@ -65,6 +65,6 @@ extern void pool_coninfo_set_frontend_connected(int proc_id, int pool_index);
 extern void pool_coninfo_unset_frontend_connected(int proc_id, int pool_index);
 
 extern void pool_alarm(pool_sighandler_t handler, unsigned int second);
-extern void pool_undo_alarm();
+extern void pool_undo_alarm(void);
 
 #endif /* POOL_PROCESS_CONTEXT_H */
index b7dcafb28603e278ffa8d3dc9ffe848cf702013d..576b2c563ce7f66e87be8450623d3f77002bd1e7 100644 (file)
@@ -6,7 +6,7 @@
  * pgpool: a language independent connection pool server for PostgreSQL 
  * written by Tatsuo Ishii
  *
- * Copyright (c) 2003-2015     PgPool Global Development Group
+ * Copyright (c) 2003-2017     PgPool Global Development Group
  *
  * Permission to use, copy, modify, and distribute this software and
  * its documentation for any purpose and without fee is hereby
@@ -284,6 +284,8 @@ typedef struct {
        UNIT unit;
 } Interval;
 
+/* Defined in pool_session_context.h */
+extern int pool_get_major_version(void);
 
 /* NUM_BACKENDS now always returns actual number of backends */
 #define NUM_BACKENDS (pool_config->backend_desc->num_backends)
index 35ca2bb66f30fad5e44d89e28770cf3075238fc8..1070c3c8631dc81a5fd5c7ada8afaee13e04dfff 100644 (file)
@@ -2323,8 +2323,6 @@ static void wakeup_children(void)
 
 static RETSIGTYPE wakeup_handler(int sig)
 {
-       int save_errno = errno;
-
        POOL_SETMASK(&BlockSig);
        wakeup_request = 1;
 
index 71a3bc93f344e53a0a6db18d95482d4563664a89..70d494f5409f2c3384c464af28a9f453517ddb0a 100644 (file)
@@ -5,7 +5,7 @@
  * pgpool: a language independent connection pool server for PostgreSQL
  * written by Tatsuo Ishii
  *
- * Copyright (c) 2003-2010     PgPool Global Development Group
+ * Copyright (c) 2003-2017     PgPool Global Development Group
  *
  * Permission to use, copy, modify, and distribute this software and
  * its documentation for any purpose and without fee is hereby
@@ -27,4 +27,3 @@ pid_t mypid;  /* pgpool parent process id */
 bool run_as_pcp_child;
 ProcessType processType;
 ProcessState processState;
-random_start_time;
index f4399ecfafa1e1c662fb5b324bdad1d413c0820c..342917cd4953f3903b17571f01c25fd20511a7fe 100644 (file)
@@ -1,4 +1,5 @@
 #include <sys/time.h>
+#include <pcp/pcp.h>
 
 struct timeval pcp_timeout;
 
index 91dde579954bd157bc0c3c7aaa8eec866e3e18cf..4795a71f195efc6e8cf9ea870fe1c37279552d18 100644 (file)
@@ -61,7 +61,7 @@ wd_init_interlock(void)
                memset((void *)WD_Locks, 0, alloc_size);
 
                ereport(DEBUG1,
-                               (errmsg("WD_Locks: sizeof(bool) (%d) * WD_MAX_LOCK_NUM (%d) = %d bytes requested for shared memory",
+                               (errmsg("WD_Locks: sizeof(bool) (%lu) * WD_MAX_LOCK_NUM (%d) = %d bytes requested for shared memory",
                                                sizeof(bool),
                                                WD_MAX_LOCK_NUM,
                                                alloc_size)));
index 9cb6ecb0679cf03a6e0628809ae7887c6928359e..1e723079374385551f306e0c0cd82aa0ff210f70 100644 (file)
@@ -6,7 +6,7 @@
  * pgpool: a language independent connection pool server for PostgreSQL
  * written by Tatsuo Ishii
  *
- * Copyright (c) 2003-2016     PgPool Global Development Group
+ * Copyright (c) 2003-2017     PgPool Global Development Group
  *
  * Permission to use, copy, modify, and distribute this software and
  * its documentation for any purpose and without fee is hereby
@@ -29,6 +29,9 @@
 #include <stdlib.h>
 #include <unistd.h>
 #include <netdb.h>
+#include <sys/types.h>
+#include <sys/wait.h>
+
 #include "pool.h"
 #include "utils/elog.h"
 #include "pool_config.h"