/[baselayout]/trunk/src/mountinfo.c
Gentoo

Diff of /trunk/src/mountinfo.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 2884 Revision 2897
257 { "point-regex", 1, NULL, 'p'}, 257 { "point-regex", 1, NULL, 'p'},
258 { "skip-point-regex", 1, NULL, 'P'}, 258 { "skip-point-regex", 1, NULL, 'P'},
259 { "options", 0, NULL, 'i'}, 259 { "options", 0, NULL, 'i'},
260 { "fstype", 0, NULL, 's'}, 260 { "fstype", 0, NULL, 's'},
261 { "node", 0, NULL, 't'}, 261 { "node", 0, NULL, 't'},
262 { "quiet", 0, NULL, 'q'},
263 longopts_COMMON 262 longopts_COMMON
264 { NULL, 0, NULL, 0} 263 { NULL, 0, NULL, 0}
265}; 264};
266#include "_usage.c" 265#include "_usage.c"
267 266
272 regex_t *point_regex = NULL; 271 regex_t *point_regex = NULL;
273 regex_t *skip_point_regex = NULL; 272 regex_t *skip_point_regex = NULL;
274 char **nodes = NULL; 273 char **nodes = NULL;
275 char *n; 274 char *n;
276 int opt; 275 int opt;
277 bool quiet = false;
278 int result; 276 int result;
279 277
280#define DO_REG(_var) \ 278#define DO_REG(_var) \
281 if (_var) free (_var); \ 279 if (_var) free (_var); \
282 _var = get_regex (optarg); 280 _var = get_regex (optarg);
318 case 's': 316 case 's':
319 args.mount_type = mount_fstype; 317 args.mount_type = mount_fstype;
320 break; 318 break;
321 case 't': 319 case 't':
322 args.mount_type = mount_from; 320 args.mount_type = mount_from;
323 break;
324 case 'q':
325 quiet = true;
326 break; 321 break;
327 322
328 case_RC_COMMON_GETOPT 323 case_RC_COMMON_GETOPT
329 } 324 }
330 } 325 }
356 STRLIST_FOREACH (nodes, n, i) { 351 STRLIST_FOREACH (nodes, n, i) {
357 if (point_regex && regexec (point_regex, n, 0, NULL, 0) != 0) 352 if (point_regex && regexec (point_regex, n, 0, NULL, 0) != 0)
358 continue; 353 continue;
359 if (skip_point_regex && regexec (skip_point_regex, n, 0, NULL, 0) == 0) 354 if (skip_point_regex && regexec (skip_point_regex, n, 0, NULL, 0) == 0)
360 continue; 355 continue;
361 if (! quiet) 356 if (! rc_is_env ("RC_QUIET", "yes"))
362 printf ("%s\n", n); 357 printf ("%s\n", n);
363 result = EXIT_SUCCESS; 358 result = EXIT_SUCCESS;
364 } 359 }
365 rc_strlist_free (nodes); 360 rc_strlist_free (nodes);
366 361

Legend:
Removed from v.2884  
changed lines
  Added in v.2897

  ViewVC Help
Powered by ViewVC 1.1.20