Skip to content

Commit

Permalink
Merge remote-tracking branch 'remotes/riku/for-2.0' into staging
Browse files Browse the repository at this point in the history
* remotes/riku/for-2.0:
  linux-user: pass correct host flags to accept4()

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
  • Loading branch information
pm215 committed Apr 3, 2014
2 parents de03c31 + d25295d commit 888157f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions linux-user/syscall.c
Original file line number Diff line number Diff line change
Expand Up @@ -2062,9 +2062,12 @@ static abi_long do_accept4(int fd, abi_ulong target_addr,
socklen_t addrlen;
void *addr;
abi_long ret;
int host_flags;

host_flags = target_to_host_bitmask(flags, fcntl_flags_tbl);

if (target_addr == 0) {
return get_errno(accept4(fd, NULL, NULL, flags));
return get_errno(accept4(fd, NULL, NULL, host_flags));
}

/* linux returns EINVAL if addrlen pointer is invalid */
Expand All @@ -2080,7 +2083,7 @@ static abi_long do_accept4(int fd, abi_ulong target_addr,

addr = alloca(addrlen);

ret = get_errno(accept4(fd, addr, &addrlen, flags));
ret = get_errno(accept4(fd, addr, &addrlen, host_flags));
if (!is_error(ret)) {
host_to_target_sockaddr(target_addr, addr, addrlen);
if (put_user_u32(addrlen, target_addrlen_addr))
Expand Down

0 comments on commit 888157f

Please sign in to comment.