The following pull request was submitted through Github.
It can be accessed and reviewed at: https://github.com/lxc/lxc/pull/1573

This e-mail was sent by the LXC bot, direct replies will not reach the author
unless they happen to be subscribed to this list.

=== Description (from pull-request) ===
I suspect that there's a glibc bug on ppc64le. Both clang and gcc a very
unhappy when you return -errno from these functions. Instead, let's return
concrete errno numbers, e.g. -EINVAL.

Signed-off-by: Christian Brauner <[email protected]>
From ff0e49c768ae23b3c700ec66ea42023c94dd1ca8 Mon Sep 17 00:00:00 2001
From: Christian Brauner <[email protected]>
Date: Thu, 18 May 2017 13:18:29 +0200
Subject: [PATCH] utils: fix ppc64le builds

I suspect that there's a glibc bug on ppc64le. Both clang and gcc a very
unhappy when you return -errno from these functions. Instead, let's return
concrete errno numbers, e.g. -EINVAL.

Signed-off-by: Christian Brauner <[email protected]>
---
 src/lxc/utils.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/lxc/utils.c b/src/lxc/utils.c
index 15c9f91..ac14793 100644
--- a/src/lxc/utils.c
+++ b/src/lxc/utils.c
@@ -2008,7 +2008,7 @@ int lxc_safe_uint(const char *numstr, unsigned int 
*converted)
        errno = 0;
        uli = strtoul(numstr, &err, 0);
        if (errno == ERANGE && uli == ULONG_MAX)
-               return -errno;
+               return -ERANGE;
 
        if (err == numstr || *err != '\0')
                return -EINVAL;
@@ -2028,10 +2028,10 @@ int lxc_safe_int(const char *numstr, int *converted)
        errno = 0;
        sli = strtol(numstr, &err, 0);
        if (errno == ERANGE && (sli == LONG_MAX || sli == LONG_MIN))
-               return -errno;
+               return -ERANGE;
 
        if (errno != 0 && sli == 0)
-               return -errno;
+               return -EINVAL;
 
        if (err == numstr || *err != '\0')
                return -EINVAL;
@@ -2051,10 +2051,10 @@ int lxc_safe_long(const char *numstr, long int 
*converted)
        errno = 0;
        sli = strtol(numstr, &err, 0);
        if (errno == ERANGE && (sli == LONG_MAX || sli == LONG_MIN))
-               return -errno;
+               return -ERANGE;
 
        if (errno != 0 && sli == 0)
-               return -errno;
+               return -EINVAL;
 
        if (err == numstr || *err != '\0')
                return -EINVAL;
_______________________________________________
lxc-devel mailing list
[email protected]
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to