summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEmmanuel Dreyfus <manu@netbsd.org>2012-12-13 15:55:40 +0100
committerAnand Avati <avati@redhat.com>2012-12-13 12:33:18 -0800
commit6dd85beaf95eee881a6c244c41e5fd5db17cdf9e (patch)
tree8e27c608b4ed84ccc92efd9ac7999e8cab0b369e
parent9a395d2db3a88d4ba479dfe0f5ad3769efee7f3a (diff)
Spurious reserved port warning fix
reserved ports is a Linux specitic concept. Make no warnings for other systems. BUG: 815227 Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org> Change-Id: I40037b9e99e7fcbdd0d153865ee7c2ef3733132e Reviewed-on: http://review.gluster.org/4308 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
-rw-r--r--libglusterfs/src/common-utils.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libglusterfs/src/common-utils.c b/libglusterfs/src/common-utils.c
index c327d4fe4..22f138614 100644
--- a/libglusterfs/src/common-utils.c
+++ b/libglusterfs/src/common-utils.c
@@ -2197,10 +2197,11 @@ generate_glusterfs_ctx_id (void)
char *
gf_get_reserved_ports ()
{
+ char *ports_info = NULL;
+#if defined GF_LINUX_HOST_OS
int proc_fd = -1;
char *proc_file = "/proc/sys/net/ipv4/ip_local_reserved_ports";
char buffer[4096] = {0,};
- char *ports_info = NULL;
int32_t ret = -1;
proc_fd = open (proc_file, O_RDONLY);
@@ -2229,6 +2230,7 @@ gf_get_reserved_ports ()
out:
if (proc_fd != -1)
close (proc_fd);
+#endif /* GF_LINUX_HOST_OS */
return ports_info;
}
@@ -2236,6 +2238,7 @@ int
gf_process_reserved_ports (gf_boolean_t *ports)
{
int ret = -1;
+#if defined GF_LINUX_HOST_OS
char *ports_info = NULL;
char *tmp = NULL;
char *blocked_port = NULL;
@@ -2265,6 +2268,7 @@ gf_process_reserved_ports (gf_boolean_t *ports)
out:
GF_FREE (ports_info);
+#endif /* GF_LINUX_HOST_OS */
return ret;
}