summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNigel Babu <nigelb@redhat.com>2018-01-22 08:36:36 +0530
committerJeff Darcy <jeff@pl.atyp.us>2018-01-23 18:08:27 +0000
commit93f21655e1584c7369aa74f3072de0dc1a3e8119 (patch)
tree485188865ed9c3cc572f9b93757d6ef59c4795df
parenta35f158f1cbe142a1f65bfc5f3c7584ec3e7bab0 (diff)
libglusterfs: Reset errno before callv4.1dev
This was causing Gluster to return a failure when testing on Centos7. BUG: 1536913 Change-Id: Idb90baef05058123a7f69e94a51dd79abd371815 Signed-off-by: Nigel Babu <nigelb@redhat.com>
-rw-r--r--libglusterfs/src/common-utils.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libglusterfs/src/common-utils.c b/libglusterfs/src/common-utils.c
index ac0325f9d60..5345924a41d 100644
--- a/libglusterfs/src/common-utils.c
+++ b/libglusterfs/src/common-utils.c
@@ -2453,7 +2453,10 @@ valid_ipv4_subnetwork (const char *address)
"Invalid IPv4 subnetwork address");
goto out;
}
-
+ /*
+ * Reset errno before checking it
+ */
+ errno = 0;
prefixlen = strtol (slash + 1, &endptr, 10);
if ((errno != 0) || (*endptr != '\0') ||
(prefixlen < 0) || (prefixlen > IPv4_ADDR_SIZE)) {