summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Tacke <8560110+ChristianTacke@users.noreply.github.com>2019-12-25 20:41:17 (GMT)
committerSven Nierlein <sven@nierlein.org>2020-01-07 09:22:39 (GMT)
commit9da7cd76813870632ff93659d176ead0848b8ee9 (patch)
treeb85f1d9ceb4bd2bfc829f99bf84057646fa8cfaa
parent7693af147926d0eb7369a43070d114b6bd79dc70 (diff)
downloadmonitoring-plugins-9da7cd76813870632ff93659d176ead0848b8ee9.tar.gz
Fix timeout_interval declarations
There are different declarations for timeout_interval: lib/utils_base.c has the definition: unsigned int timeout_interval = DEFAULT_SOCKET_TIMEOUT; lib/utils_base.h has the appropiate declaration: extern unsigned int timeout_interval; plugins/popen.h has an extra declaration: extern unsigned int timeout_interval; This doesn't hurt, but it's a dupe. The one in utils_base.h should be enough, so remove this one. plugins/popen.c has a WRONG one: extern int timeout_interval; Remove it! Use #include "utils.h" to get the right one. This makes the local defines for max/min unnecassary, so remove them also.
-rw-r--r--plugins/popen.c4
-rw-r--r--plugins/popen.h1
2 files changed, 1 insertions, 4 deletions
diff --git a/plugins/popen.c b/plugins/popen.c
index 557fb44..9eb49b6 100644
--- a/plugins/popen.c
+++ b/plugins/popen.c
@@ -39,9 +39,9 @@
39*****************************************************************************/ 39*****************************************************************************/
40 40
41#include "common.h" 41#include "common.h"
42#include "utils.h"
42 43
43/* extern so plugin has pid to kill exec'd process on timeouts */ 44/* extern so plugin has pid to kill exec'd process on timeouts */
44extern int timeout_interval;
45extern pid_t *childpid; 45extern pid_t *childpid;
46extern int *child_stderr_array; 46extern int *child_stderr_array;
47extern FILE *child_process; 47extern FILE *child_process;
@@ -76,8 +76,6 @@ RETSIGTYPE popen_timeout_alarm_handler (int);
76#define SIG_ERR ((Sigfunc *)-1) 76#define SIG_ERR ((Sigfunc *)-1)
77#endif 77#endif
78 78
79#define min(a,b) ((a) < (b) ? (a) : (b))
80#define max(a,b) ((a) > (b) ? (a) : (b))
81 79
82char *pname = NULL; /* caller can set this from argv[0] */ 80char *pname = NULL; /* caller can set this from argv[0] */
83 81
diff --git a/plugins/popen.h b/plugins/popen.h
index fc7e78e..a5dd8fa 100644
--- a/plugins/popen.h
+++ b/plugins/popen.h
@@ -7,7 +7,6 @@ FILE *spopen (const char *);
7int spclose (FILE *); 7int spclose (FILE *);
8RETSIGTYPE popen_timeout_alarm_handler (int); 8RETSIGTYPE popen_timeout_alarm_handler (int);
9 9
10extern unsigned int timeout_interval;
11pid_t *childpid=NULL; 10pid_t *childpid=NULL;
12int *child_stderr_array=NULL; 11int *child_stderr_array=NULL;
13FILE *child_process=NULL; 12FILE *child_process=NULL;