summaryrefslogtreecommitdiff
path: root/kernel/time/posix-cpu-timers.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/time/posix-cpu-timers.c')
-rw-r--r--kernel/time/posix-cpu-timers.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/kernel/time/posix-cpu-timers.c b/kernel/time/posix-cpu-timers.c
index 1563ca22cf1f..993a924d1399 100644
--- a/kernel/time/posix-cpu-timers.c
+++ b/kernel/time/posix-cpu-timers.c
@@ -1312,22 +1312,13 @@ static int do_cpu_nanosleep(const clockid_t which_clock, int flags,
* Report back to the user the time still remaining.
*/
restart = &current->restart_block;
+ restart->nanosleep.expires = timespec64_to_ns(rqtp);
if (restart->nanosleep.type != TT_NONE) {
struct timespec ts;
ts = timespec64_to_timespec(it.it_value);
-#ifdef CONFIG_COMPAT
- if (restart->nanosleep.type == TT_COMPAT) {
- if (compat_put_timespec(&ts,
- restart->nanosleep.compat_rmtp))
- return -EFAULT;
- } else
-#endif
- if (copy_to_user(restart->nanosleep.rmtp, &ts,
- sizeof(ts)))
- return -EFAULT;
+ error = nanosleep_copyout(restart, &ts);
}
- restart->nanosleep.expires = timespec64_to_ns(rqtp);
}
return error;