lib/tst_clocks.c: fix 'tst_clock_gettime()' and 'tst_clock_settime()'
PATCH 1/1 lib/tst_clocks.c: fix 'tst_clock_gettime()' and 'tst_clock_settime()'
The type of 'struct tst_ts' has to be kept between function calls because a function can be called with the wrong timespec type. For that reason, a 'static' identifier is added for 'tts' in 'tst_clock_gettime()' and 'tst_clock_settime()' as to make sure the right timespec type is passed in 'clock_gettime()' and 'clock_settime()'.
Signed-off-by Filip Bozuta <[email protected]>
--- lib/tst_clocks.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
lib/tst_clocks.c +2 -2
@@ -57,7 +57,7 @@ int tst_clock_getres(clockid_t clk_id, struct timespec *res)int tst_clock_gettime (clockid_t clk_id,struct timespec *ts) { -struct tst_ts tts = {0 , }; +static struct tst_ts tts = {0 , };static mysyscall func;int ret;
@@ -87,7 +87,7 @@ int tst_clock_gettime(clockid_t clk_id, struct timespec *ts)int tst_clock_settime (clockid_t clk_id,struct timespec *ts) { -struct tst_ts tts = {0 , }; +static struct tst_ts tts = {0 , };static mysyscall func;#if (__NR_clock_settime64 != __LTP__NR_INVALID_SYSCALL)
Signature · 1 line
2.25.1
PATCH 1/1 lib/tst_clocks.c: fix 'tst_clock_gettime()' and 'tst_clock_settime()'
Hi!
Good catch, applied, thanks.
Signature · 2 lines
Cyril Hrubis [email protected]