aboutsummaryrefslogtreecommitdiff
path: root/target/m68k
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2022-03-04 17:27:00 +0400
committerMarc-André Lureau <marcandre.lureau@redhat.com>2022-03-22 14:39:06 +0400
commit8ef2513d87ebe525540fb23a9c170da58871665c (patch)
treeae81924c58fe33f0efe366921e4bdcfac2f9cae0 /target/m68k
parent3d76c3b6d81ff59638800c003637a3a750cf8b01 (diff)
downloadqemu-8ef2513d87ebe525540fb23a9c170da58871665c.zip
qemu-8ef2513d87ebe525540fb23a9c170da58871665c.tar.gz
qemu-8ef2513d87ebe525540fb23a9c170da58871665c.tar.bz2
m68k/nios2-semi: fix gettimeofday() result check
gettimeofday() returns 0 for success. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Laurent Vivier <laurent@vivier.eu> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'target/m68k')
-rw-r--r--target/m68k/m68k-semi.c2
1 files changed, 1 insertions, 1 deletions
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? */