Skip to contentSkip to conversation

osdep.c: Fix accept4 fallback

PATCH Applied Kevin Wolf 2 participants 2 messages Jan 13, 2010

lore
Share & tools
lore

Kevin Wolf

author
#0 lore raw

PATCH 1/1 osdep.c: Fix accept4 fallback

Commit 3a03bfa5 added a fallback in case the Linux kernel running qemu is older than the kernel of the build system. Unfortunately, v1 was committed instead of v2, so the code has a bug that was revealed in the review (checking for the wrong error code).

---
 osdep.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
osdep.c +1 -1
index e4836e7..1310684 100644
@@ -297,7 +297,7 @@ int qemu_accept(int s, struct sockaddr *addr, socklen_t *addrlen)
 
 #ifdef CONFIG_ACCEPT4
     ret = accept4(s, addr, addrlen, SOCK_CLOEXEC);
-    if (ret != -1 || errno != EINVAL) {
+    if (ret != -1 || errno != ENOSYS) {
         return ret;
     }
 #endif
Signature · 1 line
1.6.2.5
#1 lore raw
Quoted 7 lines · Kevin Wolf

Commit 3a03bfa5 added a fallback in case the Linux kernel running qemu is older than the kernel of the build system. Unfortunately, v1 was committed instead of v2, so the code has a bug that was revealed in the review (checking for the wrong error code).

Applied. Thanks.

Regards,

Anthony Liguori

Quoted 18 lines
---
  osdep.c |    2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)
osdep.c +1 -1
index e4836e7..1310684 100644
@@ -297,7 +297,7 @@ int qemu_accept(int s, struct sockaddr *addr, socklen_t *addrlen)
 
  #ifdef CONFIG_ACCEPT4
      ret = accept4(s, addr, addrlen, SOCK_CLOEXEC);
-    if (ret != -1 || errno != EINVAL) {
+    if (ret != -1 || errno != ENOSYS) {
          return ret;
      }
  #endif