From 5fd2550d4c96318b2de4a4a44e15e3c50c268e79 Mon Sep 17 00:00:00 2001 From: Ton Voon Date: Thu, 25 May 2006 12:33:24 +0000 Subject: 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 --- plugins/check_snmp.c | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) (limited to 'plugins/check_snmp.c') 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 +#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 */ -- cgit v1.2.3