summaryrefslogtreecommitdiffstats
path: root/target/nios2
diff options
context:
space:
mode:
authorMarc-André Lureau2022-03-04 14:27:00 +0100
committerMarc-André Lureau2022-03-22 11:39:06 +0100
commit8ef2513d87ebe525540fb23a9c170da58871665c (patch)
treeae81924c58fe33f0efe366921e4bdcfac2f9cae0 /target/nios2
parentvl: typo fix in a comment (diff)
downloadqemu-8ef2513d87ebe525540fb23a9c170da58871665c.tar.gz
qemu-8ef2513d87ebe525540fb23a9c170da58871665c.tar.xz
qemu-8ef2513d87ebe525540fb23a9c170da58871665c.zip
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/nios2')
-rw-r--r--target/nios2/nios2-semi.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/target/nios2/nios2-semi.c b/target/nios2/nios2-semi.c
index fe5598bae4..5a7ad0c710 100644
--- a/target/nios2/nios2-semi.c
+++ b/target/nios2/nios2-semi.c
@@ -403,7 +403,7 @@ void do_nios2_semihosting(CPUNios2State *env)
qemu_timeval tv;
struct gdb_timeval *p;
result = qemu_gettimeofday(&tv);
- if (result != 0) {
+ if (result == 0) {
p = lock_user(VERIFY_WRITE, arg0, sizeof(struct gdb_timeval),
0);
if (!p) {