]> git.ipfire.org Git - thirdparty/systemd.git/commit - src/basic/time-util.c
time-util: refuse formatting/parsing times that we can't store
authorLennart Poettering <lennart@poettering.net>
Thu, 2 Feb 2017 17:30:29 +0000 (18:30 +0100)
committerLennart Poettering <lennart@poettering.net>
Thu, 2 Feb 2017 19:12:31 +0000 (20:12 +0100)
commit1bb4b028a380d74cff6399ea1d8ffcf1b2f122bc
tree041f20a932fbf9d318cf5484bf5e22e8cddae5bc
parentc477ff141b875a2a98c90514b6bf23f0436d1f73
time-util: refuse formatting/parsing times that we can't store

usec_t is always 64bit, which means it can cover quite a number of
years. However, 4 digit year display and glibc limitations around time_t
limit what we can actually parse and format. Let's make this explicit,
so that we never end up formatting dates we can#t parse and vice versa.

Note that this is really just about formatting/parsing. Internal
calculations with times outside of the formattable range are not
affected.
src/basic/calendarspec.c
src/basic/time-util.c
src/basic/time-util.h
src/shared/logs-show.c
src/test/test-date.c
src/test/test-time.c