Cleanup watchdog source code.
authorTatsuo Ishii <ishii@postgresql.org>
Sat, 16 Aug 2025 03:36:42 +0000 (12:36 +0900)
committerTatsuo Ishii <ishii@postgresql.org>
Sat, 16 Aug 2025 03:36:42 +0000 (12:36 +0900)
- Remove wd_is_upper_ok() from wd_utils.h because there's no actual
  definition for it.

- Make wd_get_ping_result() and wd_issue_ping_command() static. It's
  only used in wd_ping.c.

Backpatch-through: master only

src/include/watchdog/wd_utils.h
src/watchdog/wd_ping.c

index 0c8ad17caa170aee0b6c7a9143c9b873570a35b7..5df1fa1e9d26785b79aa12e55e33db7a94f9f018 100644 (file)
@@ -49,10 +49,7 @@ extern pid_t fork_escalation_process(void);
 extern pid_t fork_plunging_process(void);
 
 /* wd_ping.c */
-extern int     wd_is_upper_ok(char *server_list);
 extern bool wd_is_ip_exists(char *ip);
-extern bool wd_get_ping_result(char *hostname, int exit_status, int outfd);
-extern pid_t wd_issue_ping_command(char *hostname, int *outfd);
 extern pid_t wd_trusted_server_command(char *hostname);
 
 /* wd_if.c */
index 2386950f4dcf569731fe25eebff2e7b0bd493b17..ef4bf872483478d9e4f8752391b956643446a76f 100644 (file)
@@ -6,7 +6,7 @@
  * pgpool: a language independent connection pool server for PostgreSQL
  * written by Tatsuo Ishii
  *
- * Copyright (c) 2003-2022     PgPool Global Development Group
+ * Copyright (c) 2003-2025     PgPool Global Development Group
  *
  * Permission to use, copy, modify, and distribute this software and
  * its documentation for any purpose and without fee is hereby
@@ -41,6 +41,8 @@
 #define WD_MAX_PING_RESULT 256
 
 static double get_result(char *ping_data);
+static bool wd_get_ping_result(char *hostname, int exit_status, int outfd);
+static pid_t wd_issue_ping_command(char *hostname, int *outfd);
 
 /**
  * check if IP address can be pinged.
@@ -95,7 +97,7 @@ wd_is_ip_exists(char *ip)
  * function issues the ping command using the execv system call
  * and return the pid of the process.
  */
-pid_t
+static pid_t
 wd_issue_ping_command(char *hostname, int *outfd)
 {
        int                     status;
@@ -254,7 +256,7 @@ wd_trusted_server_command(char *hostname)
  * The function is helper function and can be used with the
  * wd_issue_ping_command() function to identify if the ping command
  * was successful */
-bool
+static bool
 wd_get_ping_result(char *hostname, int exit_status, int outfd)
 {
        /* First check the exit status of ping process */