OpenZFS 6447 - handful of nvpair cleanups

Authored by: Steve Dougherty <sdougherty@barracuda.com>
Reviewed by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
Reviewed by: Andy Stormont <astormont@racktopsystems.com>
Reviewed by: Garrett D'Amore <garrett@damore.org>
Approved by: Robert Mustacchi <rm@joyent.com>
Reviewed-by: Don Brady <dev.fs.zfs@gmail.com>
Reviewed-by: George Melikov <mail@gmelikov.ru>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Ported-by: Giuseppe Di Natale <dinatale2@llnl.gov>

OpenZFS-issue: https://www.illumos.org/issues/6447
OpenZFS-commit: https://github.com/openzfs/openzfs/commit/759e89b
Closes #6581
This commit is contained in:
Steve Dougherty 2015-11-10 19:41:10 -05:00 committed by Brian Behlendorf
parent ecaebdbcf6
commit de327eccbb
2 changed files with 7 additions and 3 deletions

View File

@ -24,7 +24,7 @@
*/ */
#include <unistd.h> #include <unistd.h>
#include <strings.h> #include <string.h>
#include <libintl.h> #include <libintl.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/inttypes.h> #include <sys/inttypes.h>
@ -1219,7 +1219,8 @@ nvpair_value_match_regex(nvpair_t *nvp, int ai,
break; break;
} }
case DATA_TYPE_BOOLEAN_VALUE: { case DATA_TYPE_BOOLEAN_VALUE: {
boolean_t val, val_arg; int32_t val_arg;
boolean_t val;
/* scanf boolean_t from value and check for match */ /* scanf boolean_t from value and check for match */
sr = sscanf(value, "%"SCNi32, (int32_t *)&val_arg); sr = sscanf(value, "%"SCNi32, (int32_t *)&val_arg);
@ -1230,7 +1231,8 @@ nvpair_value_match_regex(nvpair_t *nvp, int ai,
break; break;
} }
case DATA_TYPE_BOOLEAN_ARRAY: { case DATA_TYPE_BOOLEAN_ARRAY: {
boolean_t *val_array, val_arg; boolean_t *val_array;
int32_t val_arg;
/* check indexed value of array for match */ /* check indexed value of array for match */
sr = sscanf(value, "%"SCNi32, (int32_t *)&val_arg); sr = sscanf(value, "%"SCNi32, (int32_t *)&val_arg);

View File

@ -1642,6 +1642,8 @@ nvlist_lookup_nvpair_ei_sep(nvlist_t *nvl, const char *name, const char sep,
if ((nvl == NULL) || (name == NULL)) if ((nvl == NULL) || (name == NULL))
return (EINVAL); return (EINVAL);
sepp = NULL;
idx = 0;
/* step through components of name */ /* step through components of name */
for (np = name; np && *np; np = sepp) { for (np = name; np && *np; np = sepp) {
/* ensure unique names */ /* ensure unique names */