rpmsgfs_client:Fix error return exception

When handling errors through ioctl, the error returned by the server is always 0 on the client, because cookie.result is not assigned, the error returned should be in msg->result

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
This commit is contained in:
chenrun1 2024-05-13 20:24:28 +08:00 committed by Xiang Xiao
parent 8c3872b919
commit e9ac1a2317

View File

@ -174,6 +174,7 @@ static int rpmsgfs_ioctl_handler(FAR struct rpmsg_endpoint *ept,
(FAR struct rpmsgfs_cookie_s *)(uintptr_t)header->cookie;
FAR struct rpmsgfs_ioctl_s *rsp = data;
cookie->result = header->result;
if (cookie->result >= 0 && rsp->arglen > 0)
{
memcpy(cookie->data, (FAR void *)(uintptr_t)rsp->buf, rsp->arglen);