mirror of
https://github.com/monitoring-plugins/monitoring-plugins.git
synced 2026-05-28 04:35:40 -04:00
Move global variables from .h to .c files
Simplify things by moving the definition of global variables into .c files, where they belong.
This commit is contained in:
parent
b48cb1f130
commit
5b0e00782d
5 changed files with 14 additions and 22 deletions
|
|
@ -27,11 +27,12 @@
|
|||
*
|
||||
*****************************************************************************/
|
||||
|
||||
#define LOCAL_TIMEOUT_ALARM_HANDLER
|
||||
|
||||
#include "common.h"
|
||||
#include "netutils.h"
|
||||
|
||||
unsigned int socket_timeout = DEFAULT_SOCKET_TIMEOUT;
|
||||
unsigned int socket_timeout_state = STATE_CRITICAL;
|
||||
|
||||
int econn_refuse_state = STATE_CRITICAL;
|
||||
int was_refused = FALSE;
|
||||
#if USE_IPV6
|
||||
|
|
|
|||
|
|
@ -81,20 +81,14 @@ void host_or_die(const char *str);
|
|||
# define is_hostname(addr) resolve_host_or_addr(addr, AF_INET)
|
||||
#endif
|
||||
|
||||
#ifdef LOCAL_TIMEOUT_ALARM_HANDLER
|
||||
extern unsigned int socket_timeout;
|
||||
extern int socket_timeout_state;
|
||||
RETSIGTYPE socket_timeout_alarm_handler (int) __attribute__((noreturn));
|
||||
#else
|
||||
unsigned int socket_timeout = DEFAULT_SOCKET_TIMEOUT;
|
||||
unsigned int socket_timeout_state = STATE_CRITICAL;
|
||||
extern RETSIGTYPE socket_timeout_alarm_handler (int) __attribute__((noreturn));
|
||||
#endif
|
||||
|
||||
extern unsigned int socket_timeout_state;
|
||||
extern int econn_refuse_state;
|
||||
extern int was_refused;
|
||||
extern int address_family;
|
||||
|
||||
RETSIGTYPE socket_timeout_alarm_handler (int) __attribute__((noreturn));
|
||||
|
||||
/* SSL-Related functionality */
|
||||
#ifdef HAVE_SSL
|
||||
/* maybe this could be merged with the above np_net_connect, via some flags */
|
||||
|
|
|
|||
|
|
@ -27,7 +27,6 @@
|
|||
*****************************************************************************/
|
||||
|
||||
#define MAX_CN_LENGTH 256
|
||||
#define LOCAL_TIMEOUT_ALARM_HANDLER
|
||||
#include "common.h"
|
||||
#include "netutils.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -22,8 +22,6 @@
|
|||
*
|
||||
*****************************************************************************/
|
||||
|
||||
#define LOCAL_TIMEOUT_ALARM_HANDLER
|
||||
|
||||
#include "common.h"
|
||||
#include "utils.h"
|
||||
#include "utils_base.h"
|
||||
|
|
@ -38,6 +36,11 @@ extern const char *progname;
|
|||
#define STRLEN 64
|
||||
#define TXTBLK 128
|
||||
|
||||
unsigned int timeout_state = STATE_CRITICAL;
|
||||
unsigned int timeout_interval = DEFAULT_SOCKET_TIMEOUT;
|
||||
|
||||
time_t start_time, end_time;
|
||||
|
||||
/* **************************************************************************
|
||||
* max_state(STATE_x, STATE_y)
|
||||
* compares STATE_x to STATE_y and returns result based on the following
|
||||
|
|
|
|||
|
|
@ -31,17 +31,12 @@ void print_revision (const char *, const char *);
|
|||
|
||||
/* Handle timeouts */
|
||||
|
||||
#ifdef LOCAL_TIMEOUT_ALARM_HANDLER
|
||||
extern unsigned int timeout_state;
|
||||
extern unsigned int timeout_interval;
|
||||
RETSIGTYPE timeout_alarm_handler (int);
|
||||
#else
|
||||
unsigned int timeout_state = STATE_CRITICAL;
|
||||
unsigned int timeout_interval = DEFAULT_SOCKET_TIMEOUT;
|
||||
extern RETSIGTYPE timeout_alarm_handler (int);
|
||||
#endif
|
||||
|
||||
time_t start_time, end_time;
|
||||
RETSIGTYPE timeout_alarm_handler (int);
|
||||
|
||||
extern time_t start_time, end_time;
|
||||
|
||||
/* Test input types */
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue