From 8ef2513d87ebe525540fb23a9c170da58871665c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Fri, 4 Mar 2022 17:27:00 +0400 Subject: m68k/nios2-semi: fix gettimeofday() result check MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit gettimeofday() returns 0 for success. Signed-off-by: Marc-André Lureau Reviewed-by: Laurent Vivier Reviewed-by: Richard Henderson --- target/m68k/m68k-semi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'target/m68k') diff --git a/target/m68k/m68k-semi.c b/target/m68k/m68k-semi.c index 44ec7e4..c5c164e 100644 --- a/target/m68k/m68k-semi.c +++ b/target/m68k/m68k-semi.c @@ -381,7 +381,7 @@ void do_m68k_semihosting(CPUM68KState *env, int nr) qemu_timeval tv; struct gdb_timeval *p; result = qemu_gettimeofday(&tv); - if (result != 0) { + if (result == 0) { if (!(p = lock_user(VERIFY_WRITE, arg0, sizeof(struct gdb_timeval), 0))) { /* FIXME - check error code? */ -- cgit v1.1