]> git.ipfire.org Git - thirdparty/systemd.git/commit - src/basic/time-util.c
time-util: merge format_timestamp_internal() and format_timestamp_internal_us() 2547/head
authorAlexander Kuleshov <kuleshovmail@gmail.com>
Sun, 7 Feb 2016 16:11:46 +0000 (22:11 +0600)
committerAlexander Kuleshov <kuleshovmail@gmail.com>
Mon, 8 Feb 2016 18:15:40 +0000 (00:15 +0600)
commit0056086af6bea38f0a485972c79428b1b3ab7b2a
tree4b30a2062c3046960b930774a44e26f0132b75bb
parentef9fde5378c0b2614991f9e3c4ac525cc07736a8
time-util: merge format_timestamp_internal() and format_timestamp_internal_us()

The time_util.c provides format_timestamp_internal() and
format_timestamp_internal_us() functions for a timestamp formating. Both
functions are very similar and differ only in formats handling.

We can add additional boolean parameter to the format_timestamp_internal()
function which will represent is a format for us timestamp or not.
This allows us to get rid of format_timestamp_internal_us() that is prevent
code duplication.

We can remove format_timestamp_internal_us() safely, because it is static and
has no users outside of the time_util.c. New fourth parameter will be passed
inside of the format_timestamp(), format_timestamp_us() and etc, functions,
but the public API is not changed.
src/basic/time-util.c