summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sbin/mdconfig/mdconfig.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/sbin/mdconfig/mdconfig.c b/sbin/mdconfig/mdconfig.c
index 233058d..4257dd7 100644
--- a/sbin/mdconfig/mdconfig.c
+++ b/sbin/mdconfig/mdconfig.c
@@ -481,12 +481,18 @@ md_list(const char *units, int opt, const char *fflag)
printf("\n");
/* XXX: Check if it's enough to clean everything. */
geom_stats_snapshot_free(sq);
- if (((opt & OPT_UNIT) && (fflag == NULL) && ufound) ||
- ((opt & OPT_UNIT) == 0 && (fflag != NULL) && ffound) ||
- ((opt & OPT_UNIT) && (fflag != NULL) && ufound && ffound))
- return (0);
- else
- return (-1);
+ if (opt & OPT_UNIT) {
+ if (((fflag == NULL) && ufound) ||
+ ((fflag == NULL) && (units != NULL) && ufound) ||
+ ((fflag != NULL) && ffound) ||
+ ((fflag != NULL) && (units != NULL) && ufound && ffound))
+ return (0);
+ } else if (opt & OPT_LIST) {
+ if ((fflag == NULL) ||
+ ((fflag != NULL) && ffound))
+ return (0);
+ }
+ return (-1);
}
/*
OpenPOWER on IntegriCloud