From 48d071d1f576bdb3f91361a61bd2a3e1dfdc241f Mon Sep 17 00:00:00 2001 From: Fabian Keil Date: Wed, 3 Nov 2021 14:10:31 +0100 Subject: [PATCH 256/325] cddl/contrib/opensolaris/cmd/zpool/zpool_main.c: Use ctime_iso() instead of ctime() Obtained from: ElectroBSD --- .../opensolaris/cmd/zpool/zpool_main.c | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c b/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c index 35c3db7893df..e0c2ce3837a6 100644 --- a/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c +++ b/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c @@ -2320,7 +2320,7 @@ do_import(nvlist_t *config, const char *newname, const char *mntopts, "Last accessed by %s (hostid=%lx) at %s" "The pool can be imported, use 'zpool import -f' " "to import the pool.\n"), name, hostname, - (unsigned long)hostid, ctime((time_t *)×tamp)); + (unsigned long)hostid, ctime_iso((time_t *)×tamp)); } @@ -4781,14 +4781,14 @@ print_scan_status(pool_scan_stat_t *ps) "with %llu errors on %s"), processed_buf, (u_longlong_t)days_left, (u_longlong_t)hours_left, (u_longlong_t)mins_left, (u_longlong_t)secs_left, - (u_longlong_t)ps->pss_errors, ctime(&end)); + (u_longlong_t)ps->pss_errors, ctime_iso(&end)); } else if (ps->pss_func == POOL_SCAN_RESILVER) { (void) printf(gettext("resilvered %s " "in %llu days %02llu:%02llu:%02llu " "with %llu errors on %s"), processed_buf, (u_longlong_t)days_left, (u_longlong_t)hours_left, (u_longlong_t)mins_left, (u_longlong_t)secs_left, - (u_longlong_t)ps->pss_errors, ctime(&end)); + (u_longlong_t)ps->pss_errors, ctime_iso(&end)); } @@ -4796,10 +4796,10 @@ print_scan_status(pool_scan_stat_t *ps) } else if (ps->pss_state == DSS_CANCELED) { if (ps->pss_func == POOL_SCAN_SCRUB) { (void) printf(gettext("scrub canceled on %s"), - ctime(&end)); + ctime_iso(&end)); } else if (ps->pss_func == POOL_SCAN_RESILVER) { (void) printf(gettext("resilver canceled on %s"), - ctime(&end)); + ctime_iso(&end)); } return; } @@ -4810,16 +4810,16 @@ print_scan_status(pool_scan_stat_t *ps) if (ps->pss_func == POOL_SCAN_SCRUB) { if (pause == 0) { (void) printf(gettext("scrub in progress since %s"), - ctime(&start)); + ctime_iso(&start)); } else { (void) printf(gettext("scrub paused since %s"), - ctime(&pause)); + ctime_iso(&pause)); (void) printf(gettext("\tscrub started on %s"), - ctime(&start)); + ctime_iso(&start)); } } else if (ps->pss_func == POOL_SCAN_RESILVER) { (void) printf(gettext("resilver in progress since %s"), - ctime(&start)); + ctime_iso(&start)); } scanned = ps->pss_examined; @@ -4966,10 +4966,10 @@ print_removal_status(zpool_handle_t *zhp, pool_removal_stat_t *prs) copied_buf, (u_longlong_t)(minutes_taken / 60), (uint_t)(minutes_taken % 60), - ctime((time_t *)&end)); + ctime_iso((time_t *)&end)); } else if (prs->prs_state == DSS_CANCELED) { (void) printf(gettext("Removal of %s canceled on %s"), - vdev_name, ctime(&end)); + vdev_name, ctime_iso(&end)); } else { uint64_t copied, total, elapsed, mins_left, hours_left; double fraction_done; @@ -4982,7 +4982,7 @@ print_removal_status(zpool_handle_t *zhp, pool_removal_stat_t *prs) */ (void) printf(gettext( "Evacuation of %s in progress since %s"), - vdev_name, ctime(&start)); + vdev_name, ctime_iso(&start)); copied = prs->prs_copied > 0 ? prs->prs_copied : 1; total = prs->prs_to_copy; @@ -5040,10 +5040,10 @@ print_checkpoint_status(pool_checkpoint_stat_t *pcs) zfs_nicenum(pcs->pcs_space, space_buf, sizeof (space_buf)); if (pcs->pcs_state == CS_CHECKPOINT_EXISTS) { - char *date = ctime(&start); + char *date = ctime_iso(&start); /* - * ctime() adds a newline at the end of the generated + * ctime_iso() adds a newline at the end of the generated * string, thus the weird format specifier and the * strlen() call used to chop it off from the output. */ -- 2.32.0