aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2019-11-12 17:46:57 +0000
committerPeter Maydell <peter.maydell@linaro.org>2019-11-12 17:46:57 +0000
commitef45f7b3788caf7d2501702eddd912868f9c008e (patch)
treec2ebd155ae70ba8dc2e535de89bfe91b441f4f97
parent04d57cfa7eec070f54978a3c7b313428e4a282cc (diff)
parent0f1f2d4596aee037d3ccbcf10592466daa54107f (diff)
downloadqemu-ef45f7b3788caf7d2501702eddd912868f9c008e.zip
qemu-ef45f7b3788caf7d2501702eddd912868f9c008e.tar.gz
qemu-ef45f7b3788caf7d2501702eddd912868f9c008e.tar.bz2
Merge remote-tracking branch 'remotes/vivier2/tags/linux-user-for-4.2-pull-request' into staging
Fix CID 1407221 and stime() # gpg: Signature made Tue 12 Nov 2019 16:16:43 GMT # gpg: using RSA key CD2F75DDC8E3A4DC2E4F5173F30C38BD3F2FBE3C # gpg: issuer "laurent@vivier.eu" # gpg: Good signature from "Laurent Vivier <lvivier@redhat.com>" [full] # gpg: aka "Laurent Vivier <laurent@vivier.eu>" [full] # gpg: aka "Laurent Vivier (Red Hat) <lvivier@redhat.com>" [full] # Primary key fingerprint: CD2F 75DD C8E3 A4DC 2E4F 5173 F30C 38BD 3F2F BE3C * remotes/vivier2/tags/linux-user-for-4.2-pull-request: linux-user: remove host stime() syscall linux-user: fix missing break Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
-rw-r--r--linux-user/syscall.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index ab9d933..ce399a5 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -2632,6 +2632,7 @@ static abi_long do_getsockopt(int sockfd, int level, int optname,
default:
goto unimplemented;
}
+ break;
#endif /* SOL_NETLINK */
default:
unimplemented:
@@ -7763,10 +7764,12 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
#ifdef TARGET_NR_stime /* not on alpha */
case TARGET_NR_stime:
{
- time_t host_time;
- if (get_user_sal(host_time, arg1))
+ struct timespec ts;
+ ts.tv_nsec = 0;
+ if (get_user_sal(ts.tv_sec, arg1)) {
return -TARGET_EFAULT;
- return get_errno(stime(&host_time));
+ }
+ return get_errno(clock_settime(CLOCK_REALTIME, &ts));
}
#endif
#ifdef TARGET_NR_alarm /* not on alpha */