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_smtp.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_smtp.c')
-rw-r--r-- | plugins/check_smtp.c | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/plugins/check_smtp.c b/plugins/check_smtp.c index e99f0675..3dc444fc 100644 --- a/plugins/check_smtp.c +++ b/plugins/check_smtp.c @@ -59,8 +59,7 @@ void print_help (void); void print_usage (void); int my_close(void); -#ifdef HAVE_REGEX_H -#include <regex.h> +#include "regex.h" char regex_expect[MAX_INPUT_BUFFER] = ""; regex_t preg; regmatch_t pmatch[10]; @@ -69,7 +68,6 @@ char errbuf[MAX_INPUT_BUFFER]; int cflags = REG_EXTENDED | REG_NOSUB | REG_NEWLINE; int eflags = 0; int errcode, excode; -#endif int server_port = SMTP_PORT; char *server_address = NULL; @@ -308,7 +306,6 @@ main (int argc, char **argv) printf("%s", buffer); strip (buffer); if (n < nresponses) { -#ifdef HAVE_REGEX_H cflags |= REG_EXTENDED | REG_NOSUB | REG_NEWLINE; errcode = regcomp (&preg, responses[n], cflags); if (errcode != 0) { @@ -329,12 +326,6 @@ main (int argc, char **argv) printf (_("Execute Error: %s\n"), errbuf); result = STATE_UNKNOWN; } -#else - if (strstr(buffer, responses[n])!=buffer) { - result = STATE_WARNING; - printf (_("SMTP %s - Invalid response '%s' to command '%s'\n"), state_text (result), buffer, commands[n]); - } -#endif } n++; } |