]> git.proxmox.com Git - mirror_zfs.git/blobdiff - lib/libzfs/libzfs_pool.c
Fix locale-specific time
[mirror_zfs.git] / lib / libzfs / libzfs_pool.c
index b42e93e3db5d4c8dc9acf6c1245ec32526218fab..979bbdd3809a6473fd0acc4892b3c46845db968e 100644 (file)
@@ -1900,7 +1900,8 @@ zpool_rewind_exclaim(libzfs_handle_t *hdl, const char *name, boolean_t dryrun,
        (void) nvlist_lookup_int64(nv, ZPOOL_CONFIG_REWIND_TIME, &loss);
 
        if (localtime_r((time_t *)&rewindto, &t) != NULL &&
-           strftime(timestr, 128, "%c", &t) != 0) {
+           ctime_r((time_t *)&rewindto, timestr) != NULL) {
+               timestr[24] = 0;
                if (dryrun) {
                        (void) printf(dgettext(TEXT_DOMAIN,
                            "Would be able to return %s "
@@ -1962,7 +1963,8 @@ zpool_explain_recover(libzfs_handle_t *hdl, const char *name, int reason,
            "Recovery is possible, but will result in some data loss.\n"));
 
        if (localtime_r((time_t *)&rewindto, &t) != NULL &&
-           strftime(timestr, 128, "%c", &t) != 0) {
+           ctime_r((time_t *)&rewindto, timestr) != NULL) {
+               timestr[24] = 0;
                (void) printf(dgettext(TEXT_DOMAIN,
                    "\tReturning the pool to its state as of %s\n"
                    "\tshould correct the problem.  "),