diff options
author | Ton Voon <tonvoon@users.sourceforge.net> | 2006-05-25 12:33:24 +0000 |
---|---|---|
committer | Ton Voon <tonvoon@users.sourceforge.net> | 2006-05-25 12:33:24 +0000 |
commit | 5fd2550d4c96318b2de4a4a44e15e3c50c268e79 (patch) | |
tree | b712838611281a444a9b603949352bc4003de657 /plugins/check_snmp.c | |
parent | 80e155c9cf826d977393ee130a07be599401335e (diff) | |
download | monitoring-plugins-5fd2550d4c96318b2de4a4a44e15e3c50c268e79.tar.gz |
Use coreutils' regexp libraries, so regexp always available now
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1403 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'plugins/check_snmp.c')
-rw-r--r-- | plugins/check_snmp.c | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/plugins/check_snmp.c b/plugins/check_snmp.c index b53fb112..9ff3439e 100644 --- a/plugins/check_snmp.c +++ b/plugins/check_snmp.c @@ -75,8 +75,7 @@ char *nextarg (char *str); void print_usage (void); void print_help (void); -#ifdef HAVE_REGEX_H -#include <regex.h> +#include "regex.h" char regex_expect[MAX_INPUT_BUFFER] = ""; regex_t preg; regmatch_t pmatch[10]; @@ -86,7 +85,6 @@ char perfstr[MAX_INPUT_BUFFER]; int cflags = REG_EXTENDED | REG_NOSUB | REG_NEWLINE; int eflags = 0; int errcode, excode; -#endif char *server_address = NULL; char *community = NULL; @@ -292,7 +290,6 @@ main (int argc, char **argv) /* Process this block for regex matching */ else if (eval_method[i] & CRIT_REGEX) { -#ifdef HAVE_REGEX_H excode = regexec (&preg, response, 10, pmatch, eflags); if (excode == 0) { iresult = STATE_OK; @@ -305,10 +302,6 @@ main (int argc, char **argv) else { iresult = STATE_CRITICAL; } -#else - printf (_("Call for regex which was not a compiled option")); - exit (STATE_UNKNOWN); -#endif } /* Process this block for existence-nonexistence checks */ @@ -542,11 +535,8 @@ process_arguments (int argc, char **argv) ii++; break; case 'R': /* regex */ -#ifdef HAVE_REGEX_H cflags = REG_ICASE; -#endif case 'r': /* regex */ -#ifdef HAVE_REGEX_H cflags |= REG_EXTENDED | REG_NOSUB | REG_NEWLINE; strncpy (regex_expect, optarg, sizeof (regex_expect) - 1); regex_expect[sizeof (regex_expect) - 1] = 0; @@ -558,10 +548,6 @@ process_arguments (int argc, char **argv) } eval_method[jj++] = CRIT_REGEX; ii++; -#else - printf (_("call for regex which was not a compiled option")); - exit (STATE_UNKNOWN); -#endif break; /* Format */ |