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>
---
linux-user/syscall.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index e541fbe09a..52693b4239 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -2809,8 +2809,9 @@ get_timeout:
ret = get_errno(getsockopt(sockfd, level, optname, &val, &lv));
if (ret < 0)
return ret;
- if (optname == SO_TYPE) {
- val = host_to_target_sock_type(val);
+ switch (optname) {
+ case SO_TYPE: val = host_to_target_sock_type(val); break;
+ case SO_ERROR: val = host_to_target_errno(val); break;