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:
parent
8c3872b919
commit
e9ac1a2317
@ -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_cookie_s *)(uintptr_t)header->cookie;
|
||||||
FAR struct rpmsgfs_ioctl_s *rsp = data;
|
FAR struct rpmsgfs_ioctl_s *rsp = data;
|
||||||
|
|
||||||
|
cookie->result = header->result;
|
||||||
if (cookie->result >= 0 && rsp->arglen > 0)
|
if (cookie->result >= 0 && rsp->arglen > 0)
|
||||||
{
|
{
|
||||||
memcpy(cookie->data, (FAR void *)(uintptr_t)rsp->buf, rsp->arglen);
|
memcpy(cookie->data, (FAR void *)(uintptr_t)rsp->buf, rsp->arglen);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user