break;
}
- if (ne->ne_order < best->ne_order || best == NULL)
+ if (best == NULL || ne->ne_order < best->ne_order)
best = ne;
}
}
}
#endif /* HAVE_LIBBLKID */
-#define DEFAULT_IMPORT_PATH_SIZE 8
-
-static char *
+char *
zpool_default_import_path[DEFAULT_IMPORT_PATH_SIZE] = {
"/dev/disk/by-vdev", /* Custom rules, use first if they exist */
"/dev/disk/zpool", /* Custom rules, use first if they exist */
if (config != NULL) {
boolean_t matched = B_TRUE;
+ char *pname;
+
+ if ((iarg->poolname != NULL) &&
+ (nvlist_lookup_string(config,
+ ZPOOL_CONFIG_POOL_NAME, &pname) == 0)) {
- if (iarg->poolname != NULL) {
- char *pname;
+ if (strcmp(iarg->poolname, pname))
+ matched = B_FALSE;
- matched = nvlist_lookup_string(config,
- ZPOOL_CONFIG_POOL_NAME,
- &pname) == 0 &&
- strcmp(iarg->poolname, pname) == 0;
} else if (iarg->guid != 0) {
uint64_t this_guid;