mirror of
https://git.proxmox.com/git/qemu
synced 2025-08-06 23:45:57 +00:00
qtest: avoid a warning with RTC test
Avoid this warning on OpenBSD: CC tests/rtc-test.o /src/qemu/tests/rtc-test.c: In function 'check_time': /src/qemu/tests/rtc-test.c:171: warning: format '%ld' expects type 'long int', but argument 2 has type 'time_t' /src/qemu/tests/rtc-test.c:173: warning: format '%ld' expects type 'long int', but argument 2 has type 'time_t' Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
This commit is contained in:
parent
6b7cff76e0
commit
02b3efcb75
@ -161,12 +161,12 @@ static void check_time(int wiggle)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!(tm_cmp(&start, datep) <= 0 && tm_cmp(datep, &end) <= 0)) {
|
if (!(tm_cmp(&start, datep) <= 0 && tm_cmp(datep, &end) <= 0)) {
|
||||||
time_t t, s;
|
long t, s;
|
||||||
|
|
||||||
start.tm_isdst = datep->tm_isdst;
|
start.tm_isdst = datep->tm_isdst;
|
||||||
|
|
||||||
t = mktime(datep);
|
t = (long)mktime(datep);
|
||||||
s = mktime(&start);
|
s = (long)mktime(&start);
|
||||||
if (t < s) {
|
if (t < s) {
|
||||||
g_test_message("RTC is %ld second(s) behind wall-clock\n", (s - t));
|
g_test_message("RTC is %ld second(s) behind wall-clock\n", (s - t));
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user