From 93f21655e1584c7369aa74f3072de0dc1a3e8119 Mon Sep 17 00:00:00 2001 From: Nigel Babu Date: Mon, 22 Jan 2018 08:36:36 +0530 Subject: libglusterfs: Reset errno before call This was causing Gluster to return a failure when testing on Centos7. BUG: 1536913 Change-Id: Idb90baef05058123a7f69e94a51dd79abd371815 Signed-off-by: Nigel Babu --- libglusterfs/src/common-utils.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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)) { -- cgit