aboutsummaryrefslogtreecommitdiff
path: root/lib/utils_disk.c
diff options
context:
space:
mode:
authorGravatar Matthias Eble <psychotrahe@users.sourceforge.net> 2007-03-30 08:53:58 +0000
committerGravatar Matthias Eble <psychotrahe@users.sourceforge.net> 2007-03-30 08:53:58 +0000
commit0f71b7d07a8badd9aa38ef8d847bd982ab2db72c (patch)
treefba1316686bdb6f891ac92ba67f4c3e4e4dc7940 /lib/utils_disk.c
parent0ff58b90631e9b62da23c4c9487d3d8d310f2d7f (diff)
downloadmonitoring-plugins-0f71b7d07a8badd9aa38ef8d847bd982ab2db72c.tar.gz
check_disk: added regex functionality -r and -R. see np-devel mail (2007-02-10)
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1658 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'lib/utils_disk.c')
-rw-r--r--lib/utils_disk.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/utils_disk.c b/lib/utils_disk.c
index 877b80d9..cfd6a979 100644
--- a/lib/utils_disk.c
+++ b/lib/utils_disk.c
@@ -155,3 +155,13 @@ np_seen_name(struct name_list *list, const char *name)
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;
+ }
+}