summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/check_disk.c27
1 files changed, 9 insertions, 18 deletions
diff --git a/plugins/check_disk.c b/plugins/check_disk.c
index 585c4a66..fd3b9770 100644
--- a/plugins/check_disk.c
+++ b/plugins/check_disk.c
@@ -201,10 +201,9 @@ main (int argc, char **argv)
201 201
202 for (me = mount_list; me; me = me->me_next) { 202 for (me = mount_list; me; me = me->me_next) {
203 203
204 if ((dev_select_list && 204 if (path_select_list &&
205 walk_name_list (dev_select_list, me->me_devname)) || 205 (walk_name_list (path_select_list, me->me_mountdir) ||
206 (path_select_list && 206 walk_name_list (path_select_list, me->me_devname) ) )
207 walk_name_list (path_select_list, me->me_mountdir)))
208 get_fs_usage (me->me_mountdir, me->me_devname, &fsp); 207 get_fs_usage (me->me_mountdir, me->me_devname, &fsp);
209 else if (dev_select_list || path_select_list) 208 else if (dev_select_list || path_select_list)
210 continue; 209 continue;
@@ -275,11 +274,11 @@ int
275process_arguments (int argc, char **argv) 274process_arguments (int argc, char **argv)
276{ 275{
277 int c; 276 int c;
278 struct name_list *se; 277 struct name_list *se;
279 struct name_list **pathtail = &path_select_list; 278 struct name_list **pathtail = &path_select_list;
280 struct name_list **devtail = &dev_select_list; 279 struct name_list **devtail = &dev_select_list;
281 struct name_list **fstail = &fs_exclude_list; 280 struct name_list **fstail = &fs_exclude_list;
282 struct name_list **dptail = &dp_exclude_list; 281 struct name_list **dptail = &dp_exclude_list;
283 282
284 int option_index = 0; 283 int option_index = 0;
285 static struct option long_options[] = { 284 static struct option long_options[] = {
@@ -292,7 +291,6 @@ process_arguments (int argc, char **argv)
292 {"units", required_argument, 0, 'u'}, 291 {"units", required_argument, 0, 'u'},
293 {"path", required_argument, 0, 'p'}, 292 {"path", required_argument, 0, 'p'},
294 {"partition", required_argument, 0, 'p'}, 293 {"partition", required_argument, 0, 'p'},
295 {"device", required_argument, 0, 'd'},
296 {"exclude_device", required_argument, 0, 'x'}, 294 {"exclude_device", required_argument, 0, 'x'},
297 {"exclude-type", required_argument, 0, 'X'}, 295 {"exclude-type", required_argument, 0, 'X'},
298 {"mountpoint", no_argument, 0, 'M'}, 296 {"mountpoint", no_argument, 0, 'M'},
@@ -318,7 +316,7 @@ process_arguments (int argc, char **argv)
318 strcpy (argv[c], "-t"); 316 strcpy (argv[c], "-t");
319 317
320 while (1) { 318 while (1) {
321 c = getopt_long (argc, argv, "+?Vqhvet:c:w:u:p:d:x:X:mklM", long_options, &option_index); 319 c = getopt_long (argc, argv, "+?Vqhvet:c:w:u:p:x:X:mklM", long_options, &option_index);
322 320
323 if (c == -1 || c == EOF) 321 if (c == -1 || c == EOF)
324 break; 322 break;
@@ -402,13 +400,6 @@ process_arguments (int argc, char **argv)
402 *pathtail = se; 400 *pathtail = se;
403 pathtail = &se->name_next; 401 pathtail = &se->name_next;
404 break; 402 break;
405 case 'd': /* select partition/device */
406 se = (struct name_list *) malloc (sizeof (struct name_list));
407 se->name = strdup (optarg);
408 se->name_next = NULL;
409 *devtail = se;
410 devtail = &se->name_next;
411 break;
412 case 'x': /* exclude path or partition */ 403 case 'x': /* exclude path or partition */
413 se = (struct name_list *) malloc (sizeof (struct name_list)); 404 se = (struct name_list *) malloc (sizeof (struct name_list));
414 se->name = strdup (optarg); 405 se->name = strdup (optarg);