Patchwork osdep.c: Fix accept4 fallback

login
register
mail settings
Submitter Kevin Wolf
Date Jan. 13, 2010, 3:20 p.m.
Message ID <1263396056-7816-1-git-send-email-kwolf@redhat.com>
Download mbox | patch
Permalink /patch/42828/
State New
Headers show

Comments

Kevin Wolf - Jan. 13, 2010, 3:20 p.m.
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).

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 osdep.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Anthony Liguori - Jan. 13, 2010, 11:28 p.m.
On 01/13/2010 09:20 AM, Kevin Wolf wrote:
> 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).
>
> Signed-off-by: Kevin Wolf<kwolf@redhat.com>
>    

Applied.  Thanks.

Regards,

Anthony Liguori
> ---
>   osdep.c |    2 +-
>   1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/osdep.c b/osdep.c
> index e4836e7..1310684 100644
> --- a/osdep.c
> +++ b/osdep.c
> @@ -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
>

Patch

diff --git a/osdep.c b/osdep.c
index e4836e7..1310684 100644
--- a/osdep.c
+++ b/osdep.c
@@ -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