[LTP] [PATCH v2 2/2] syscalls/clock_adjtime: create clock_adjtime syscall tests
Petr Vorel
pvorel@suse.cz
Tue Feb 26 01:17:16 CET 2019
Hi Rafael,
> diff --git a/testcases/kernel/syscalls/clock_adjtime/clock_adjtime01.c b/testcases/kernel/syscalls/clock_adjtime/clock_adjtime01.c
> new file mode 100644
> index 000000000..541d9437d
...
> + SAFE_CLOCK_ADJTIME(CLOCK_REALTIME, &ttxc);
> + timex_show("SET", ttxc);
> +
> + if (tc[i].ptr) {
> +
> + /* adjtimex field being tested so we can verify later */
> +
> + ptroff = (long) tc[i].ptr - (long) &ttxc;
> + ptr = (void *) &verify + ptroff;
> + }
> +
> + TEST(sys_clock_adjtime(CLOCK_REALTIME, &verify));
> + timex_show("VERIFY", verify);
> +
> + if (tc[i].ptr && *tc[i].ptr != *ptr) {
Can you please fix this compiler error:
clock_adjtime01.c: In function ‘verify_clock_adjtime’:
clock_adjtime01.c:199:33: warning: ‘ptr’ may be used uninitialized in this function [-Wmaybe-uninitialized]
if (tc[i].ptr && *tc[i].ptr != *ptr) {
Kind regards,
Petr
More information about the ltp
mailing list