summaryrefslogtreecommitdiffstats
path: root/libglusterfs
diff options
context:
space:
mode:
authorEmmanuel Dreyfus <manu@netbsd.org>2014-08-04 09:52:09 +0200
committerVijay Bellur <vbellur@redhat.com>2014-10-30 01:39:51 -0700
commit3b022b19b77c3a159682b76998fa9ac9518e1c3c (patch)
tree59689075ffdbfce9c85e32823009e0d27b216470 /libglusterfs
parentfb2e0a4afbe3263ebda3e1d2b72d921b2d7e2c50 (diff)
Use F_CLOSEM if available
Use F_CLOSEM to close all file descriptors if available. BUG: 764655 Change-Id: Ib3c682825b89c163ebb152848f2533b3cb62cdce Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org> Reviewed-on: http://review.gluster.org/8379 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com> Reviewed-by: Humble Devassy Chirammal <humble.devassy@gmail.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'libglusterfs')
-rw-r--r--libglusterfs/src/run.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/libglusterfs/src/run.c b/libglusterfs/src/run.c
index 4fd2a3a0d79..93fe12aed10 100644
--- a/libglusterfs/src/run.c
+++ b/libglusterfs/src/run.c
@@ -289,7 +289,10 @@ runner_start (runner_t *runner)
closedir (d);
} else
ret = -1;
-#else
+#else /* !GF_LINUX_HOST_OS */
+#ifdef F_CLOSEM /* NetBSD */
+ (void)fcntl(3, F_CLOSEM);
+#else /* !F_CLOSEM */
struct rlimit rl;
ret = getrlimit (RLIMIT_NOFILE, &rl);
GF_ASSERT (ret == 0);
@@ -298,7 +301,8 @@ runner_start (runner_t *runner)
if (i != xpi[1])
close (i);
}
-#endif
+#endif /* !F_CLOSEM */
+#endif /* !GF_LINUX_HOST_OS */
}
if (ret != -1) {