Skip to content

Commit

Permalink
Fix locale-specific time
Browse files Browse the repository at this point in the history
  • Loading branch information
part1zano committed Feb 10, 2024
1 parent 79c6dff commit 8741d66
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions cmd/zpool/zpool_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2307,19 +2307,22 @@ print_status_trim(vdev_stat_t *vs, boolean_t verbose)
}

(void) localtime_r(&t, &zaction_ts);
(void) strftime(tbuf, sizeof (tbuf), "%c", &zaction_ts);
(void) ctime_r(&t, tbuf);

switch (vs->vs_trim_state) {
case VDEV_TRIM_SUSPENDED:
(void) snprintf(zbuf, sizeof (zbuf), ", %s %s",
(void) snprintf(zbuf, sizeof (zbuf),
", %s %.24s",
gettext("suspended, started at"), tbuf);
break;
case VDEV_TRIM_ACTIVE:
(void) snprintf(zbuf, sizeof (zbuf), ", %s %s",
(void) snprintf(zbuf, sizeof (zbuf),
", %s %.24s",
gettext("started at"), tbuf);
break;
case VDEV_TRIM_COMPLETE:
(void) snprintf(zbuf, sizeof (zbuf), ", %s %s",
(void) snprintf(zbuf, sizeof (zbuf),
", %s %.24s",
gettext("completed at"), tbuf);
break;
}
Expand Down

0 comments on commit 8741d66

Please sign in to comment.