[monitoring-plugins] check_smtp: delare file local variables static
Lorenz Kästle
git at monitoring-plugins.org
Fri Nov 8 23:10:13 CET 2024
Module: monitoring-plugins
Branch: master
Commit: d330b975b3c580c385c736c8a52209919de1d582
Author: Lorenz Kästle <12514511+RincewindsHat at users.noreply.github.com>
Date: Fri Nov 8 12:47:32 2024 +0100
URL: https://www.monitoring-plugins.org/repositories/monitoring-plugins/commit/?id=d330b97
check_smtp: delare file local variables static
---
plugins/check_smtp.c | 94 +++++++++++++++++++++++++---------------------------
1 file changed, 46 insertions(+), 48 deletions(-)
diff --git a/plugins/check_smtp.c b/plugins/check_smtp.c
index bc17528..c73693c 100644
--- a/plugins/check_smtp.c
+++ b/plugins/check_smtp.c
@@ -64,61 +64,59 @@ enum {
#define EHLO_SUPPORTS_STARTTLS 1
-int process_arguments (int, char **);
-int validate_arguments (void);
-void print_help (void);
+static int process_arguments (int, char **);
+static int validate_arguments (void);
+static void print_help (void);
void print_usage (void);
-void smtp_quit(void);
-int recvline(char *, size_t);
-int recvlines(char *, size_t);
-int my_close(void);
+static void smtp_quit(void);
+static int recvline(char *, size_t);
+static int recvlines(char *, size_t);
+static int my_close(void);
#include "regex.h"
-char regex_expect[MAX_INPUT_BUFFER] = "";
-regex_t preg;
-regmatch_t pmatch[10];
-char timestamp[20] = "";
-char errbuf[MAX_INPUT_BUFFER];
-int cflags = REG_EXTENDED | REG_NOSUB | REG_NEWLINE;
-int eflags = 0;
-int errcode, excode;
-
-int server_port = SMTP_PORT;
-int server_port_option = 0;
-char *server_address = NULL;
-char *server_expect = NULL;
-char *mail_command = NULL;
-char *from_arg = NULL;
-int send_mail_from=0;
-int ncommands=0;
-int command_size=0;
-int nresponses=0;
-int response_size=0;
-char **commands = NULL;
-char **responses = NULL;
-char *authtype = NULL;
-char *authuser = NULL;
-char *authpass = NULL;
-double warning_time = 0;
-bool check_warning_time = false;
-double critical_time = 0;
-bool check_critical_time = false;
-int verbose = 0;
-bool use_ssl = false;
-bool use_starttls = false;
-bool use_sni = false;
-bool use_proxy_prefix = false;
-bool use_ehlo = false;
-bool use_lhlo = false;
-bool ssl_established = false;
-char *localhostname = NULL;
-int sd;
-char buffer[MAX_INPUT_BUFFER];
+static regex_t preg;
+static regmatch_t pmatch[10];
+static char errbuf[MAX_INPUT_BUFFER];
+static int cflags = REG_EXTENDED | REG_NOSUB | REG_NEWLINE;
+static int eflags = 0;
+static int errcode, excode;
+
+static int server_port = SMTP_PORT;
+static int server_port_option = 0;
+static char *server_address = NULL;
+static char *server_expect = NULL;
+static char *mail_command = NULL;
+static char *from_arg = NULL;
+static int send_mail_from=0;
+static int ncommands=0;
+static int command_size=0;
+static int nresponses=0;
+static int response_size=0;
+static char **commands = NULL;
+static char **responses = NULL;
+static char *authtype = NULL;
+static char *authuser = NULL;
+static char *authpass = NULL;
+static double warning_time = 0;
+static bool check_warning_time = false;
+static double critical_time = 0;
+static bool check_critical_time = false;
+static int verbose = 0;
+static bool use_ssl = false;
+static bool use_starttls = false;
+static bool use_sni = false;
+static bool use_proxy_prefix = false;
+static bool use_ehlo = false;
+static bool use_lhlo = false;
+static bool ssl_established = false;
+static char *localhostname = NULL;
+static int sd;
+static char buffer[MAX_INPUT_BUFFER];
enum {
TCP_PROTOCOL = 1,
UDP_PROTOCOL = 2,
};
-bool ignore_send_quit_failure = false;
+static bool ignore_send_quit_failure = false;
int
More information about the Commits
mailing list