From: Zdenek Kabelac Date: Fri, 9 Aug 2024 13:37:59 +0000 (+0200) Subject: Revert "tests: use put_time" X-Git-Tag: v2_03_26~19 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=90368623571c9325638303f9430912e799679870;p=lvm2.git Revert "tests: use put_time" This reverts commit b4af2571dbee9dab5717bb166ed63df5ae63974b. std::put_time is a relatively new feature so breaks builds on older systems. --- diff --git a/test/lib/brick-shelltest.h b/test/lib/brick-shelltest.h index 1b65bd9ea..15e21cca7 100644 --- a/test/lib/brick-shelltest.h +++ b/test/lib/brick-shelltest.h @@ -319,9 +319,12 @@ struct Journal { of << ru->second; else { struct tm time_info; + char buf[64]; time_t t = time( 0 ); - if (localtime_r(&t, &time_info)) - of << "--- " << std::put_time( &time_info, "%F %T" ) << " ---"; + if (localtime_r(&t, &time_info)) { + strftime(buf, sizeof(buf), "%F %T", &time_info); + of << "--- " << buf << " ---"; + } } of << std::endl; }