mirror of https://github.com/xemu-project/xemu.git
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>
This commit is contained in:
parent
3d76c3b6d8
commit
8ef2513d87
|
@ -381,7 +381,7 @@ void do_m68k_semihosting(CPUM68KState *env, int nr)
|
||||||
qemu_timeval tv;
|
qemu_timeval tv;
|
||||||
struct gdb_timeval *p;
|
struct gdb_timeval *p;
|
||||||
result = qemu_gettimeofday(&tv);
|
result = qemu_gettimeofday(&tv);
|
||||||
if (result != 0) {
|
if (result == 0) {
|
||||||
if (!(p = lock_user(VERIFY_WRITE,
|
if (!(p = lock_user(VERIFY_WRITE,
|
||||||
arg0, sizeof(struct gdb_timeval), 0))) {
|
arg0, sizeof(struct gdb_timeval), 0))) {
|
||||||
/* FIXME - check error code? */
|
/* FIXME - check error code? */
|
||||||
|
|
|
@ -403,7 +403,7 @@ void do_nios2_semihosting(CPUNios2State *env)
|
||||||
qemu_timeval tv;
|
qemu_timeval tv;
|
||||||
struct gdb_timeval *p;
|
struct gdb_timeval *p;
|
||||||
result = qemu_gettimeofday(&tv);
|
result = qemu_gettimeofday(&tv);
|
||||||
if (result != 0) {
|
if (result == 0) {
|
||||||
p = lock_user(VERIFY_WRITE, arg0, sizeof(struct gdb_timeval),
|
p = lock_user(VERIFY_WRITE, arg0, sizeof(struct gdb_timeval),
|
||||||
0);
|
0);
|
||||||
if (!p) {
|
if (!p) {
|
||||||
|
|
Loading…
Reference in New Issue