diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2018-05-21 20:39:09 +0200 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2018-05-31 14:30:23 +0200 |
commit | d3d280242cc9cdfaf0184860029ddd738b6fa952 (patch) | |
tree | e4dc2661ca2d1d73f838dfb1e9322d68f9eba1fe /src/test/test-time-util.c | |
parent | fuzz-journal-remote: write to /dev/null not stdout (diff) | |
download | systemd-d3d280242cc9cdfaf0184860029ddd738b6fa952.tar.xz systemd-d3d280242cc9cdfaf0184860029ddd738b6fa952.zip |
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.
Diffstat (limited to 'src/test/test-time-util.c')
-rw-r--r-- | src/test/test-time-util.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/test/test-time-util.c b/src/test/test-time-util.c index 5b8e7c7b35..ab4b7ce282 100644 --- a/src/test/test-time-util.c +++ b/src/test/test-time-util.c @@ -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); } |