diff options
author | Sen Haerens <[email protected]> | 2017-08-03 18:56:15 +0200 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2017-08-03 09:56:15 -0700 |
commit | 1e1c398033384106c8ee96435ba0683797b41a46 (patch) | |
tree | 1334bc7e92ddb577a22585c060e60c9d3b81fc87 /cmd/zpool/zpool_main.c | |
parent | b0bd8ffecd70b46e584e2e52ea74f2373b544217 (diff) |
Fix zpool events scripted mode tab separator
Reviewed-by: George Melikov <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Tony Hutter <[email protected]>
Reviewed-by: Giuseppe Di Natale <[email protected]>
Signed-off-by: Sen Haerens <[email protected]>
Closes #6444
Closes #6445
Diffstat (limited to 'cmd/zpool/zpool_main.c')
-rw-r--r-- | cmd/zpool/zpool_main.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/cmd/zpool/zpool_main.c b/cmd/zpool/zpool_main.c index f597109d2..338b9952c 100644 --- a/cmd/zpool/zpool_main.c +++ b/cmd/zpool/zpool_main.c @@ -7347,7 +7347,7 @@ typedef struct ev_opts { } ev_opts_t; static void -zpool_do_events_short(nvlist_t *nvl) +zpool_do_events_short(nvlist_t *nvl, ev_opts_t *opts) { char ctime_str[26], str[32], *ptr; int64_t *tv; @@ -7360,7 +7360,10 @@ zpool_do_events_short(nvlist_t *nvl) (void) strncpy(str+7, ctime_str+20, 4); /* '1993' */ (void) strncpy(str+12, ctime_str+11, 8); /* '21:49:08' */ (void) sprintf(str+20, ".%09lld", (longlong_t)tv[1]); /* '.123456789' */ - (void) printf(gettext("%s "), str); + if (opts->scripted) + (void) printf(gettext("%s\t"), str); + else + (void) printf(gettext("%s "), str); verify(nvlist_lookup_string(nvl, FM_CLASS, &ptr) == 0); (void) printf(gettext("%s\n"), ptr); @@ -7624,7 +7627,7 @@ zpool_do_events_next(ev_opts_t *opts) if (dropped > 0) (void) printf(gettext("dropped %d events\n"), dropped); - zpool_do_events_short(nvl); + zpool_do_events_short(nvl, opts); if (opts->verbose) { zpool_do_events_nvprint(nvl, 8); |