e7a346
From e7ae5922eb334a155d7aba72509d74247c526970 Mon Sep 17 00:00:00 2001
e7a346
From: Nigel Babu <nigelb@redhat.com>
e7a346
Date: Mon, 22 Jan 2018 08:36:36 +0530
e7a346
Subject: [PATCH 139/139] libglusterfs: Reset errno before call
e7a346
e7a346
This was causing Gluster to return a failure when testing on Centos7.
e7a346
e7a346
>upstream mainline patch : https://review.gluster.org/#/c/19262/
e7a346
e7a346
BUG: 1539699
e7a346
Change-Id: Idb90baef05058123a7f69e94a51dd79abd371815
e7a346
Signed-off-by: Nigel Babu <nigelb@redhat.com>
e7a346
Reviewed-on: https://code.engineering.redhat.com/gerrit/129395
e7a346
Reviewed-by: Nigel Babu <nbabu@redhat.com>
e7a346
---
e7a346
 libglusterfs/src/common-utils.c | 5 ++++-
e7a346
 1 file changed, 4 insertions(+), 1 deletion(-)
e7a346
e7a346
diff --git a/libglusterfs/src/common-utils.c b/libglusterfs/src/common-utils.c
e7a346
index 772f4e0..378ed05 100644
e7a346
--- a/libglusterfs/src/common-utils.c
e7a346
+++ b/libglusterfs/src/common-utils.c
e7a346
@@ -2453,7 +2453,10 @@ valid_ipv4_subnetwork (const char *address)
e7a346
                                   "Invalid IPv4 subnetwork address");
e7a346
                 goto out;
e7a346
         }
e7a346
-
e7a346
+        /*
e7a346
+         * Reset errno before checking it
e7a346
+         */
e7a346
+        errno = 0;
e7a346
         prefixlen = strtol (slash + 1, &endptr, 10);
e7a346
         if ((errno != 0) || (*endptr != '\0') ||
e7a346
             (prefixlen < 0) || (prefixlen > IPv4_ADDR_SIZE)) {
e7a346
-- 
e7a346
1.8.3.1
e7a346