linux-user: fix error propagation in clock_gettime
authorMax Filippov <jcmvbkbc@gmail.com>
Sun, 1 Apr 2018 20:14:04 +0000 (13:14 -0700)
committerMax Filippov <jcmvbkbc@gmail.com>
Sun, 1 Apr 2018 21:22:04 +0000 (14:22 -0700)
host_to_target_timespec may return error if target address could not be
locked, but it is ignored.
Propagate return value of host_to_target_timespec to the caller of
clock_gettime.

Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
linux-user/syscall.c

index d51e2a00ee31e70b60a18f3d70d83c141264b69e..52e2f9c16479077ee4500f798195b52347118e10 100644 (file)
@@ -11884,7 +11884,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
         struct timespec ts;
         ret = get_errno(clock_gettime(arg1, &ts));
         if (!is_error(ret)) {
-            host_to_target_timespec(arg2, &ts);
+            ret = host_to_target_timespec(arg2, &ts);
         }
         break;
     }