mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-12-11 16:00:50 -07:00
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>
This commit is contained in:
parent
95fc5ed4a8
commit
cb88b7c214
1 changed files with 6 additions and 1 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue