summaryrefslogtreecommitdiff
path: root/linux-user
diff options
context:
space:
mode:
authorLaurent Vivier <laurent@vivier.eu>2016-06-21 19:51:13 +0200
committerRiku Voipio <riku.voipio@linaro.org>2016-07-19 15:20:58 +0300
commitef759f6fcc8ee892178e087f99e731bbedada4fb (patch)
treeb060ccb7e28fc50f8b5991bd30564c6f8b2dbb0e /linux-user
parentad31cd4c6945d7e0f0546d92d29dcd12325b4e4a (diff)
linux-user: fd_trans_*_data() returns the length
fd_trans_target_to_host_data() and fd_trans_host_to_target_data() must return the length of processed data. Signed-off-by: Laurent Vivier <laurent@vivier.eu> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
Diffstat (limited to 'linux-user')
-rw-r--r--linux-user/syscall.c36
1 files changed, 32 insertions, 4 deletions
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 8bf6205dc2..59defff01f 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -2826,12 +2826,26 @@ static TargetFdTrans target_packet_trans = {
#ifdef CONFIG_RTNETLINK
static abi_long netlink_route_target_to_host(void *buf, size_t len)
{
- return target_to_host_nlmsg_route(buf, len);
+ abi_long ret;
+
+ ret = target_to_host_nlmsg_route(buf, len);
+ if (ret < 0) {
+ return ret;
+ }
+
+ return len;
}
static abi_long netlink_route_host_to_target(void *buf, size_t len)
{
- return host_to_target_nlmsg_route(buf, len);
+ abi_long ret;
+
+ ret = host_to_target_nlmsg_route(buf, len);
+ if (ret < 0) {
+ return ret;
+ }
+
+ return len;
}
static TargetFdTrans target_netlink_route_trans = {
@@ -2842,12 +2856,26 @@ static TargetFdTrans target_netlink_route_trans = {
static abi_long netlink_audit_target_to_host(void *buf, size_t len)
{
- return target_to_host_nlmsg_audit(buf, len);
+ abi_long ret;
+
+ ret = target_to_host_nlmsg_audit(buf, len);
+ if (ret < 0) {
+ return ret;
+ }
+
+ return len;
}
static abi_long netlink_audit_host_to_target(void *buf, size_t len)
{
- return host_to_target_nlmsg_audit(buf, len);
+ abi_long ret;
+
+ ret = host_to_target_nlmsg_audit(buf, len);
+ if (ret < 0) {
+ return ret;
+ }
+
+ return len;
}
static TargetFdTrans target_netlink_audit_trans = {