[Nagiosplug-checkins] nagiosplug/lib utils_disk.c, 1.4, 1.5 utils_disk.h, 1.5, 1.6
Matthias Eble
psychotrahe at users.sourceforge.net
Fri Mar 30 10:54:00 CEST 2007
Update of /cvsroot/nagiosplug/nagiosplug/lib
In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv551/lib
Modified Files:
utils_disk.c utils_disk.h
Log Message:
check_disk: added regex functionality -r and -R. see np-devel mail (2007-02-10)
Index: utils_disk.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/lib/utils_disk.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- utils_disk.c 30 Mar 2007 08:52:28 -0000 1.4
+++ utils_disk.c 30 Mar 2007 08:53:58 -0000 1.5
@@ -155,3 +155,13 @@
return FALSE;
}
+int
+np_regex_match_mount_entry (struct mount_entry* me, regex_t* re)
+{
+ if (regexec(re, me->me_devname, (size_t) 0, NULL, 0) == 0 ||
+ regexec(re, me->me_mountdir, (size_t) 0, NULL, 0) == 0 ) {
+ return true;
+ } else {
+ return false;
+ }
+}
Index: utils_disk.h
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/lib/utils_disk.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- utils_disk.h 30 Mar 2007 08:52:28 -0000 1.5
+++ utils_disk.h 30 Mar 2007 08:53:58 -0000 1.6
@@ -2,6 +2,7 @@
#include "mountlist.h"
#include "utils_base.h"
+#include "regex.h"
struct name_list
{
@@ -32,3 +33,4 @@
struct parameter_list *np_find_parameter(struct parameter_list *list, const char *name);
int search_parameter_list (struct parameter_list *list, const char *name);
void np_set_best_match(struct parameter_list *desired, struct mount_entry *mount_list, int exact);
+int np_regex_match_mount_entry (struct mount_entry* me, regex_t* re);
More information about the Commits
mailing list