linux-user getsockopt() doesn't return the correct errnos for certain
cases.  This fixes errnos for unsupported levels and unsupported SOL_IP
option names.
Index: qemu/linux-user/syscall.c
===================================================================
--- qemu.orig/linux-user/syscall.c	2007-12-12 20:48:56.000000000 -0700
+++ qemu/linux-user/syscall.c	2007-12-12 20:50:05.000000000 -0700
@@ -1010,14 +1010,15 @@
             }
             break;
         default:
-            goto unimplemented;
+            ret = -TARGET_ENOPROTOOPT;
+            break;
         }
         break;
     default:
     unimplemented:
         gemu_log("getsockopt level=%d optname=%d not yet supported\n",
                  level, optname);
-        ret = -TARGET_ENOSYS;
+        ret = -TARGET_EOPNOTSUPP;
         break;
     }
     return ret;

Reply via email to