aboutsummaryrefslogtreecommitdiff
path: root/linux-user
diff options
context:
space:
mode:
authorHelge Deller <deller@gmx.de>2023-01-27 21:25:27 +0100
committerLaurent Vivier <laurent@vivier.eu>2023-02-03 22:55:12 +0100
commitcb88b7c214511736fa3bc1d9e57b23efcc61d8ab (patch)
tree19fa88dbf687c520e25d9eb9641726f4367861c5 /linux-user
parent95fc5ed4a86b0d173bf55daf32e1697d11062648 (diff)
downloadqemu-cb88b7c214511736fa3bc1d9e57b23efcc61d8ab.zip
qemu-cb88b7c214511736fa3bc1d9e57b23efcc61d8ab.tar.gz
qemu-cb88b7c214511736fa3bc1d9e57b23efcc61d8ab.tar.bz2
linux-user: Fix SO_ERROR return code of getsockopt()
Add translation for the host error return code of: getsockopt(19, SOL_SOCKET, SO_ERROR, [ECONNREFUSED], [4]) = 0 This fixes the testsuite of the cockpit debian package with a hppa-linux guest on a x86-64 host. Signed-off-by: Helge Deller <deller@gmx.de> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Laurent Vivier <laurent@vivier.eu> Message-Id: <Y9QzNzXg0hrzHQeo@p100> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Diffstat (limited to 'linux-user')
-rw-r--r--linux-user/syscall.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 210db5f..1c42df6 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -2758,8 +2758,13 @@ get_timeout:
ret = get_errno(getsockopt(sockfd, level, optname, &val, &lv));
if (ret < 0)
return ret;
- if (optname == SO_TYPE) {
+ switch (optname) {
+ case SO_TYPE:
val = host_to_target_sock_type(val);
+ break;
+ case SO_ERROR:
+ val = host_to_target_errno(val);
+ break;
}
if (len > lv)
len = lv;