diff options
author | Matus Kysel | 2020-09-30 17:16:16 +0200 |
---|---|---|
committer | Laurent Vivier | 2020-10-26 12:00:22 +0100 |
commit | e554eb4bb56395b1e3b7042dc6974dc87de3f4d1 (patch) | |
tree | 255e3eac00ab40be096fc6261d15fb4f75a4041f | |
parent | linux-user: remove _sysctl (diff) | |
download | qemu-e554eb4bb56395b1e3b7042dc6974dc87de3f4d1.tar.gz qemu-e554eb4bb56395b1e3b7042dc6974dc87de3f4d1.tar.xz qemu-e554eb4bb56395b1e3b7042dc6974dc87de3f4d1.zip |
linux-user: correct errno returned from accept4() syscall
accept4() returned wrong errno, that did not match current linux
Signed-off-by: Matus Kysel <mkysel@tachyum.com>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20200930151616.3588165-1-mkysel@tachyum.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
-rw-r--r-- | linux-user/syscall.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/linux-user/syscall.c b/linux-user/syscall.c index f0df6aecef..6fef8181e7 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -3491,16 +3491,16 @@ static abi_long do_accept4(int fd, abi_ulong target_addr, return get_errno(safe_accept4(fd, NULL, NULL, host_flags)); } - /* linux returns EINVAL if addrlen pointer is invalid */ + /* linux returns EFAULT if addrlen pointer is invalid */ if (get_user_u32(addrlen, target_addrlen_addr)) - return -TARGET_EINVAL; + return -TARGET_EFAULT; if ((int)addrlen < 0) { return -TARGET_EINVAL; } if (!access_ok(VERIFY_WRITE, target_addr, addrlen)) - return -TARGET_EINVAL; + return -TARGET_EFAULT; addr = alloca(addrlen); |