Always allow timestamps to be printed
If the timestamp is above 9999-12-30, (or 2038-something-something on 32 bit), use XXXX-XX-XX XX:XX:XX as the replacement. The problem with refusing to print timestamps is that our code accepts such timestamps, so we can't really just refuse to process them afterwards. Also, it makes journal files non-portable, because suddently we might completely refuse to print entries which are totally OK on a different machine.
This commit is contained in:
@@ -287,11 +287,12 @@ static void test_format_timestamp_utc(void) {
|
||||
|
||||
#if SIZEOF_TIME_T == 8
|
||||
test_format_timestamp_utc_one(USEC_TIMESTAMP_FORMATTABLE_MAX, "Thu 9999-12-30 23:59:59 UTC");
|
||||
test_format_timestamp_utc_one(USEC_TIMESTAMP_FORMATTABLE_MAX + 1, "--- XXXX-XX-XX XX:XX:XX");
|
||||
#elif SIZEOF_TIME_T == 4
|
||||
test_format_timestamp_utc_one(USEC_TIMESTAMP_FORMATTABLE_MAX, "Tue 2038-01-19 03:14:07 UTC");
|
||||
test_format_timestamp_utc_one(USEC_TIMESTAMP_FORMATTABLE_MAX + 1, "--- XXXX-XX-XX XX:XX:XX");
|
||||
#endif
|
||||
|
||||
test_format_timestamp_utc_one(USEC_TIMESTAMP_FORMATTABLE_MAX+1, NULL);
|
||||
test_format_timestamp_utc_one(USEC_INFINITY, NULL);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user