qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] linux-user: Fix SO_ERROR return code of getsockopt()
@ 2022-12-16 10:10 Helge Deller
  2023-01-26 16:55 ` Laurent Vivier
  0 siblings, 1 reply; 8+ messages in thread
From: Helge Deller @ 2022-12-16 10:10 UTC (permalink / raw)
  To: Laurent Vivier, Richard Henderson, qemu-devel; +Cc: Helge Deller

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;
         }
         if (len > lv)
             len = lv;
--
2.38.1



^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2023-01-30  8:46 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-16 10:10 [PATCH] linux-user: Fix SO_ERROR return code of getsockopt() Helge Deller
2023-01-26 16:55 ` Laurent Vivier
2023-01-26 18:27   ` Helge Deller
2023-01-26 19:43     ` Laurent Vivier
2023-01-27 20:25       ` [PATCH v2] " Helge Deller
2023-01-27 22:55         ` Richard Henderson
2023-01-30  8:42         ` Laurent Vivier
2023-01-30  8:45         ` Laurent Vivier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).