Author: hrs
Date: Thu Oct  9 23:17:18 2014
New Revision: 272854
URL: https://svnweb.freebsd.org/changeset/base/272854

Log:
  MFC r257036:
  
    Return 0 if:
  
      1. "-u N" specified, no -f, and mdN found,
      2. no -u, "-f /pathname" specified, and mdN associated with /pathname 
found,
      3. "-u N" specified, "-f /pathname" specified, and both of them found,
      4. "-l" specified and no -f,
      5. "-l" specified, "-f /pathname" specified, and /pathname found.
  
    otherwise return -1.

Modified:
  stable/10/sbin/mdconfig/mdconfig.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sbin/mdconfig/mdconfig.c
==============================================================================
--- stable/10/sbin/mdconfig/mdconfig.c  Thu Oct  9 23:15:26 2014        
(r272853)
+++ stable/10/sbin/mdconfig/mdconfig.c  Thu Oct  9 23:17:18 2014        
(r272854)
@@ -481,12 +481,18 @@ md_list(const char *units, int opt, cons
                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);
 }
 
 /*
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to