aboutsummaryrefslogtreecommitdiff
path: root/support/timespec.c
AgeCommit message (Collapse)Author
2019-05-20support: Add missing EOL terminators on timespecMike Crowe
The original implementations of test_timespec_before_impl and test_timespec_equal_or_after in 519839965197291924895a3988804e325035beee were missing the backslash required for a newline. Checked on x86_64-linux-gnu. * support/timespec.c: Add backslash to correct newline in failure message. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2019-05-10support: Fix timespec printfAdhemerval Zanella
The patch print timespec members as intmax_t instead of long int. It avoid the -Werror=format= build issue on x32: timespec.c: In function 'test_timespec_before_impl': timespec.c:32:23: error: format '%ld' expects argument of type 'long int', but argument 4 has type '__time_t' {aka 'const long long int'} [-Werror=format=] Checked on x86_64-linux-gnu-x32, x86_64-linux-gnu, and i686-linux-gnu. * support/timespec.c (test_timespec_before_impl, test_timespec_equal_or_after_impl): print timespec member as intmax_t insted of long int. Reviewed-by: Florian Weimer <fweimer@redhat.com>
2019-05-09support: Add timespec.hMike Crowe
It adds useful functions for tests that use struct timespec. Checked on x86_64-linux-gnu and i686-linux-gnu. * support/timespec.h: New file. Provide timespec helper functions along with macros in the style of those in check.h. * support/timespec.c: New file. Implement check functions declared in support/timespec.h. * support/timespec-add.c: New file from gnulib containing timespec_add implementation that handles overflow. * support/timespec-sub.c: New file from gnulib containing timespec_sub implementation that handles overflow. * support/README: Mention timespec.h. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>