HomeClusterLabs Projects

Refactor: libcrmcommon: Use g_date_time_format() instead of strftime()

Description

Refactor: libcrmcommon: Use g_date_time_format() instead of strftime()

strftime() requires a fixed-size buffer. It's not feasible to determine
in advance how large the buffer will need to be, since a user configures
the format string for alert timestamps.

Using g_date_time_format() fixes this. However, it does not support
certain syntax, such as a width field or a literal '%' character (unless
escaped as "%%"). So we need to maintain backward compatibility for now,
lest alert timestamps break for some users.

This also moves us one step closer toward drastically shrinking
Pacemaker's time libraries, perhaps in favor of GDateTime.

Ref T432

Signed-off-by: Reid Wahl <nrwahl@protonmail.com>

Details

Provenance
nrwahl2Authored on Thu, Jun 26, 9:00 PM
Parents
rPa5658f7d006a: Refactor: libcrmcommon: Make pcmk__time_hr_convert() static
Branches
Unknown
Tags
Unknown
Tasks
Restricted Maniphest Task