Make sure that we copy in on lock() and don't copy back out on unlock().
Signed-off-by: Warner Losh <[email protected]>
---
bsd-user/freebsd/os-time.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/bsd-user/freebsd/os-time.h b/bsd-user/freebsd/os-time.h
index 29436997ce..ec379b6927 100644
--- a/bsd-user/freebsd/os-time.h
+++ b/bsd-user/freebsd/os-time.h
@@ -149,12 +149,12 @@ static inline abi_long do_freebsd_settimeofday(abi_long
arg1, abi_long arg2)
struct timezone tz, *target_tz; /* XXX */
if (arg2 != 0) {
- if (!lock_user_struct(VERIFY_READ, target_tz, arg2, 0)) {
+ if (!lock_user_struct(VERIFY_READ, target_tz, arg2, 1)) {
return -TARGET_EFAULT;
}
__get_user(tz.tz_minuteswest, &target_tz->tz_minuteswest);
__get_user(tz.tz_dsttime, &target_tz->tz_dsttime);
- unlock_user_struct(target_tz, arg2, 1);
+ unlock_user_struct(target_tz, arg2, 0);
}
if (t2h_freebsd_timeval(&tv, arg1)) {
return -TARGET_EFAULT;
--
2.52.0