Remove the argument from get_errno

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao 2020-05-01 18:15:33 +08:00 committed by Alan Carvalho de Assis
parent 542b684f73
commit 1c024a6d39
2 changed files with 11 additions and 10 deletions

View File

@ -481,7 +481,7 @@ static int hostfs_rpmsg_closedir_handler(FAR struct rpmsg_endpoint *ept,
nxsem_wait(&priv->sem);
priv->dirs[msg->fd] = NULL;
nxsem_post(&priv->sem);
ret = ret ? get_errno(ret) : 0;
ret = ret ? -get_errno() : 0;
}
msg->header.result = ret;
@ -496,7 +496,7 @@ static int hostfs_rpmsg_statfs_handler(FAR struct rpmsg_endpoint *ept,
int ret;
ret = statfs(msg->pathname, &msg->buf);
msg->header.result = ret ? get_errno(ret) : 0;
msg->header.result = ret ? -get_errno() : 0;
return rpmsg_send(ept, msg, sizeof(*msg));
}
@ -508,7 +508,7 @@ static int hostfs_rpmsg_unlink_handler(FAR struct rpmsg_endpoint *ept,
int ret;
ret = unlink(msg->pathname);
msg->header.result = ret ? get_errno(ret) : 0;
msg->header.result = ret ? -get_errno() : 0;
return rpmsg_send(ept, msg, sizeof(*msg));
}
@ -520,7 +520,7 @@ static int hostfs_rpmsg_mkdir_handler(FAR struct rpmsg_endpoint *ept,
int ret;
ret = mkdir(msg->pathname, msg->mode);
msg->header.result = ret ? get_errno(ret) : 0;
msg->header.result = ret ? -get_errno() : 0;
return rpmsg_send(ept, msg, sizeof(*msg));
}
@ -532,7 +532,7 @@ static int hostfs_rpmsg_rmdir_handler(FAR struct rpmsg_endpoint *ept,
int ret;
ret = rmdir(msg->pathname);
msg->header.result = ret ? get_errno(ret) : 0;
msg->header.result = ret ? -get_errno() : 0;
return rpmsg_send(ept, msg, sizeof(*msg));
}
@ -549,7 +549,7 @@ static int hostfs_rpmsg_rename_handler(FAR struct rpmsg_endpoint *ept,
newpath = msg->pathname + oldlen;
ret = rename(msg->pathname, newpath);
msg->header.result = ret ? get_errno(ret) : 0;
msg->header.result = ret ? -get_errno() : 0;
return rpmsg_send(ept, msg, sizeof(*msg));
}
@ -561,7 +561,7 @@ static int hostfs_rpmsg_stat_handler(FAR struct rpmsg_endpoint *ept,
int ret;
ret = stat(msg->pathname, &msg->buf);
msg->header.result = ret ? get_errno(ret) : 0;
msg->header.result = ret ? -get_errno() : 0;
return rpmsg_send(ept, msg, sizeof(*msg));
}
@ -623,8 +623,9 @@ static void hostfs_rpmsg_ns_unbind(FAR struct rpmsg_endpoint *ept)
kmm_free(priv);
}
static int hostfs_rpmsg_ept_cb(FAR struct rpmsg_endpoint *ept, FAR void *data,
size_t len, uint32_t src, FAR void *priv)
static int hostfs_rpmsg_ept_cb(FAR struct rpmsg_endpoint *ept,
FAR void *data, size_t len, uint32_t src,
FAR void *priv)
{
struct hostfs_rpmsg_header_s *header = data;
uint32_t command = header->command;

View File

@ -93,7 +93,7 @@
# define errno *get_errno_ptr()
# define set_errno(e) do { errno = (int)(e); } while (0)
# define get_errno(e) errno
# define get_errno() errno
#else