Skip to content

Commit

Permalink
Fix zpool events scripted mode tab separator
Browse files Browse the repository at this point in the history
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 openzfs#6444 
Closes openzfs#6445
  • Loading branch information
SenH authored and behlendorf committed Aug 3, 2017
1 parent b0bd8ff commit 1e1c398
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions cmd/zpool/zpool_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 1e1c398

Please sign in to comment.