summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Maydell2014-04-03 15:31:20 +0200
committerPeter Maydell2014-04-03 15:31:20 +0200
commit888157fe96f68488efcdf50cbdb6f72291ab903e (patch)
treea81d6c78e450a6cf5aef8763fdfc5a6f114f5b4f
parentbswap: Fix build on FreeBSD 10.0 (diff)
parentlinux-user: pass correct host flags to accept4() (diff)
downloadqemu-888157fe96f68488efcdf50cbdb6f72291ab903e.tar.gz
qemu-888157fe96f68488efcdf50cbdb6f72291ab903e.tar.xz
qemu-888157fe96f68488efcdf50cbdb6f72291ab903e.zip
Merge remote-tracking branch 'remotes/riku/for-2.0' into staging
* remotes/riku/for-2.0: linux-user: pass correct host flags to accept4() Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
-rw-r--r--linux-user/syscall.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 2eac6d5aa9..9864813b7a 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -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 */
@@ -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))