summaryrefslogtreecommitdiffstats
path: root/cmd/zpool/zpool_main.c
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2014-01-24 15:43:07 -0800
committerBrian Behlendorf <[email protected]>2014-04-02 13:10:08 -0700
commitd21705eab952e5aa1c0bcf920b76e8428384d80b (patch)
tree3b9b8dabcc7bf1adde7e8c95b1540f32764e3d43 /cmd/zpool/zpool_main.c
parent1a5c611a2281b792634672a267b9c9cd7b60ef12 (diff)
Add missing DATA_TYPE_STRING_ARRAY output
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 <[email protected]> Signed-off-by: Chris Dunlap <[email protected]> Issue #2
Diffstat (limited to 'cmd/zpool/zpool_main.c')
-rw-r--r--cmd/zpool/zpool_main.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/cmd/zpool/zpool_main.c b/cmd/zpool/zpool_main.c
index cc13e3739..e38213c85 100644
--- a/cmd/zpool/zpool_main.c
+++ b/cmd/zpool/zpool_main.c
@@ -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: