aboutsummaryrefslogtreecommitdiff
path: root/linux-user/syscall.c
diff options
context:
space:
mode:
Diffstat (limited to 'linux-user/syscall.c')
-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 210db5f0be..1c42df6518 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;