Skip to content

Commit

Permalink
Add missing DATA_TYPE_STRING_ARRAY output
Browse files Browse the repository at this point in the history
This functionality has always been missing.  But until now there
were no zevents which included an array of strings so it wasn't
missed.  However, that's now changed so to ensure this information
is output correctly by 'zpool events -v' the DATA_TYPE_STRING_ARRAY
has been implemented.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Chris Dunlap <cdunlap@llnl.gov>
Issue #2
  • Loading branch information
behlendorf committed Apr 2, 2014
1 parent 1a5c611 commit d21705e
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion cmd/zpool/zpool_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -5439,7 +5439,18 @@ zpool_do_events_nvprint(nvlist_t *nvl, int depth)
break;
}

case DATA_TYPE_STRING_ARRAY:
case DATA_TYPE_STRING_ARRAY: {
char **str;
uint_t i, nelem;

(void) nvpair_value_string_array(nvp, &str, &nelem);
for (i = 0; i < nelem; i++)
printf(gettext("\"%s\" "),
str[i] ? str[i] : "<NULL>");

break;
}

case DATA_TYPE_BOOLEAN_ARRAY:
case DATA_TYPE_BYTE_ARRAY:
case DATA_TYPE_DOUBLE:
Expand Down

0 comments on commit d21705e

Please sign in to comment.