提交 2a0db420 编写于 作者: O openharmony_ci 提交者: Gitee

!616 release分支解决nanosleep 接口的rmtp参数被错误清零问题

Merge pull request !616 from wanghao-free/OpenHarmony_1.0.1_release
......@@ -355,13 +355,18 @@ int SysNanoSleep(const struct timespec *rqtp, struct timespec *rmtp)
{
int ret;
struct timespec srqtp;
struct timespec srmtp = { 0 };
struct timespec srmtp;
if (!rqtp || LOS_ArchCopyFromUser(&srqtp, rqtp, sizeof(struct timespec))) {
errno = EFAULT;
return -EFAULT;
}
if (rmtp && LOS_ArchCopyFromUser(&srmtp, rmtp, sizeof(struct timespec))) {
errno = EFAULT;
return -EFAULT;
}
ret = nanosleep(&srqtp, rmtp ? &srmtp : NULL);
if (ret < 0) {
return -get_errno();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册