* [PATCH librdmacm 1/8] Add "foreign" option to AM_INIT_AUTOMAKE
[not found] ` <cover.1374011243.git.ydroneaud-RlY5vtjFyJ3QT0dZR+AlfA@public.gmane.org>
@ 2013-07-16 21:59 ` Yann Droneaud
2013-07-16 21:59 ` [PATCH librdmacm 2/8] Makefile.am: Fix an automake warning Yann Droneaud
` (6 subsequent siblings)
7 siblings, 0 replies; 14+ messages in thread
From: Yann Droneaud @ 2013-07-16 21:59 UTC (permalink / raw)
To: Sean Hefty, linux-rdma-u79uwXL29TY76Z2rM5mHXA
Cc: Bart Van Assche, Yann Droneaud
From: Bart Van Assche <bvanassche-HInyCGIudOg@public.gmane.org>
Switch to the modern form of the AM_INIT_AUTOMAKE macro and tell
automake that the librdmacm package does not follow the GNU
standards. This change makes it possible to use 'autoreconf' for the
librdmacm package.
Signed-off-by: Bart Van Assche <bvanassche-HInyCGIudOg@public.gmane.org>
Signed-off-by: Yann Droneaud <ydroneaud-RlY5vtjFyJ3QT0dZR+AlfA@public.gmane.org>
---
configure.ac | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac
index 35d79dd..20c2f94 100644
--- a/configure.ac
+++ b/configure.ac
@@ -6,7 +6,7 @@ AC_CONFIG_SRCDIR([src/cma.c])
AC_CONFIG_AUX_DIR(config)
AC_CONFIG_MACRO_DIR(config)
AC_CONFIG_HEADERS(config.h)
-AM_INIT_AUTOMAKE(librdmacm, 1.0.17)
+AM_INIT_AUTOMAKE([foreign])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
AM_PROG_LIBTOOL
--
1.8.3.1
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 14+ messages in thread* [PATCH librdmacm 2/8] Makefile.am: Fix an automake warning
[not found] ` <cover.1374011243.git.ydroneaud-RlY5vtjFyJ3QT0dZR+AlfA@public.gmane.org>
2013-07-16 21:59 ` [PATCH librdmacm 1/8] Add "foreign" option to AM_INIT_AUTOMAKE Yann Droneaud
@ 2013-07-16 21:59 ` Yann Droneaud
2013-07-16 21:59 ` [PATCH librdmacm 3/8] autogen.sh: Use autoreconf in autogen.sh Yann Droneaud
` (5 subsequent siblings)
7 siblings, 0 replies; 14+ messages in thread
From: Yann Droneaud @ 2013-07-16 21:59 UTC (permalink / raw)
To: Sean Hefty, linux-rdma-u79uwXL29TY76Z2rM5mHXA
Cc: Bart Van Assche, Yann Droneaud
From: Bart Van Assche <bvanassche-HInyCGIudOg@public.gmane.org>
Fix the following automake warning message:
Makefile.am:1: `INCLUDES' is the old name for `AM_CPPFLAGS' (or `*_CPPFLAGS')
A quote from the automake manual:
INCLUDES
This does the same job as AM_CPPFLAGS (or any per-target _CPPFLAGS variable
if it is used). It is an older name for the same functionality. This
variable is deprecated; we suggest using AM_CPPFLAGS and per-target
_CPPFLAGS instead.
Signed-off-by: Bart Van Assche <bvanassche-HInyCGIudOg@public.gmane.org>
Signed-off-by: Yann Droneaud <ydroneaud-RlY5vtjFyJ3QT0dZR+AlfA@public.gmane.org>
---
Makefile.am | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile.am b/Makefile.am
index 3198165..e1be9f3 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,4 +1,4 @@
-INCLUDES = -I$(srcdir)/include
+AM_CPPFLAGS = -I$(srcdir)/include
rslibdir = $(libdir)/rsocket
lib_LTLIBRARIES = src/librdmacm.la
--
1.8.3.1
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 14+ messages in thread* [PATCH librdmacm 3/8] autogen.sh: Use autoreconf in autogen.sh
[not found] ` <cover.1374011243.git.ydroneaud-RlY5vtjFyJ3QT0dZR+AlfA@public.gmane.org>
2013-07-16 21:59 ` [PATCH librdmacm 1/8] Add "foreign" option to AM_INIT_AUTOMAKE Yann Droneaud
2013-07-16 21:59 ` [PATCH librdmacm 2/8] Makefile.am: Fix an automake warning Yann Droneaud
@ 2013-07-16 21:59 ` Yann Droneaud
[not found] ` <317ae98daf0eec49ffb297a5fc59b3738366af6d.1374011243.git.ydroneaud-RlY5vtjFyJ3QT0dZR+AlfA@public.gmane.org>
2013-07-16 21:59 ` [PATCH librdmacm 4/8] configure: Apply updates proposed by autoupdate Yann Droneaud
` (4 subsequent siblings)
7 siblings, 1 reply; 14+ messages in thread
From: Yann Droneaud @ 2013-07-16 21:59 UTC (permalink / raw)
To: Sean Hefty, linux-rdma-u79uwXL29TY76Z2rM5mHXA; +Cc: Jeff Squyres, Yann Droneaud
From: Jeff Squyres <jsquyres-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
The old sequence of Autotools commands listed in autogen.sh is no
longer correct. Instead, just use the single "autoreconf" command,
which will invoke all the Right Autotools commands in the correct
order.
Signed-off-by: Jeff Squyres <jsquyres-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
Signed-off-by: Yann Droneaud <ydroneaud-RlY5vtjFyJ3QT0dZR+AlfA@public.gmane.org>
---
autogen.sh | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/autogen.sh b/autogen.sh
index f433312..6c9233e 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -1,9 +1,4 @@
#! /bin/sh
set -x
-test -d ./config || mkdir ./config
-aclocal -I config
-libtoolize --force --copy
-autoheader
-automake --foreign --add-missing --copy
-autoconf
+autoreconf -ifv -I config
--
1.8.3.1
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 14+ messages in thread* [PATCH librdmacm 4/8] configure: Apply updates proposed by autoupdate
[not found] ` <cover.1374011243.git.ydroneaud-RlY5vtjFyJ3QT0dZR+AlfA@public.gmane.org>
` (2 preceding siblings ...)
2013-07-16 21:59 ` [PATCH librdmacm 3/8] autogen.sh: Use autoreconf in autogen.sh Yann Droneaud
@ 2013-07-16 21:59 ` Yann Droneaud
2013-07-16 21:59 ` [PATCH librdmacm 5/8] configure: Use automake's option "subdir-objects" Yann Droneaud
` (3 subsequent siblings)
7 siblings, 0 replies; 14+ messages in thread
From: Yann Droneaud @ 2013-07-16 21:59 UTC (permalink / raw)
To: Sean Hefty, linux-rdma-u79uwXL29TY76Z2rM5mHXA; +Cc: Yann Droneaud
'autoupdate' is a tool to help developer to update configure.ac.
This patch applies a few fixes as suggested by autoupdate.
Signed-off-by: Yann Droneaud <ydroneaud-RlY5vtjFyJ3QT0dZR+AlfA@public.gmane.org>
---
configure.ac | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/configure.ac b/configure.ac
index 20c2f94..a9e95c0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,18 +1,18 @@
dnl Process this file with autoconf to produce a configure script.
-AC_PREREQ(2.57)
-AC_INIT(librdmacm, 1.0.17, linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org)
+AC_PREREQ([2.63])
+AC_INIT([librdmacm],[1.0.17],[linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org])
AC_CONFIG_SRCDIR([src/cma.c])
AC_CONFIG_AUX_DIR(config)
AC_CONFIG_MACRO_DIR(config)
-AC_CONFIG_HEADERS(config.h)
+AC_CONFIG_HEADERS([config.h])
AM_INIT_AUTOMAKE([foreign])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
-AM_PROG_LIBTOOL
+LT_INIT
AC_ARG_WITH([valgrind],
- AC_HELP_STRING([--with-valgrind],
+ AS_HELP_STRING([--with-valgrind],
[Enable valgrind annotations - default NO]))
if test "$with_valgrind" != "" && test "$with_valgrind" != "no"; then
@@ -50,8 +50,8 @@ AC_CHECK_MEMBER(struct ibv_path_record.service_id, [],
dnl Check for gcc atomic intrinsics
AC_MSG_CHECKING(compiler support for atomics)
-AC_TRY_LINK([int i = 0;],
- [ return __sync_add_and_fetch(&i, 1) != __sync_sub_and_fetch(&i, 1); ],
+AC_LINK_IFELSE([AC_LANG_PROGRAM([[int i = 0;]],
+ [[ return __sync_add_and_fetch(&i, 1) != __sync_sub_and_fetch(&i, 1); ]])],
[ AC_MSG_RESULT(yes) ],
[
AC_MSG_RESULT(no)
--
1.8.3.1
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 14+ messages in thread* [PATCH librdmacm 5/8] configure: Use automake's option "subdir-objects"
[not found] ` <cover.1374011243.git.ydroneaud-RlY5vtjFyJ3QT0dZR+AlfA@public.gmane.org>
` (3 preceding siblings ...)
2013-07-16 21:59 ` [PATCH librdmacm 4/8] configure: Apply updates proposed by autoupdate Yann Droneaud
@ 2013-07-16 21:59 ` Yann Droneaud
2013-07-16 21:59 ` [PATCH librdmacm 6/8] Add .gitignore rules Yann Droneaud
` (2 subsequent siblings)
7 siblings, 0 replies; 14+ messages in thread
From: Yann Droneaud @ 2013-07-16 21:59 UTC (permalink / raw)
To: Sean Hefty, linux-rdma-u79uwXL29TY76Z2rM5mHXA; +Cc: Yann Droneaud
Following advice in "Autotool Mythbuster" [1], option subdir-objects
can be used to have Makefiles create object files in the same
directory than theirs source files.
It reduces clobbering in the build directory.
[1] "Autotool Mythbuster", by Diego Elio "Flameeyes" Petten`o
http://www.flameeyes.eu/autotools-mythbuster/automake/nonrecursive.html
Signed-off-by: Yann Droneaud <ydroneaud-RlY5vtjFyJ3QT0dZR+AlfA@public.gmane.org>
---
configure.ac | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac
index a9e95c0..807470f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -6,7 +6,7 @@ AC_CONFIG_SRCDIR([src/cma.c])
AC_CONFIG_AUX_DIR(config)
AC_CONFIG_MACRO_DIR(config)
AC_CONFIG_HEADERS([config.h])
-AM_INIT_AUTOMAKE([foreign])
+AM_INIT_AUTOMAKE([foreign subdir-objects])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
LT_INIT
--
1.8.3.1
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 14+ messages in thread* [PATCH librdmacm 6/8] Add .gitignore rules
[not found] ` <cover.1374011243.git.ydroneaud-RlY5vtjFyJ3QT0dZR+AlfA@public.gmane.org>
` (4 preceding siblings ...)
2013-07-16 21:59 ` [PATCH librdmacm 5/8] configure: Use automake's option "subdir-objects" Yann Droneaud
@ 2013-07-16 21:59 ` Yann Droneaud
2013-07-16 21:59 ` [PATCH librdmacm 7/8] Remove executable mode bit on plain text files Yann Droneaud
2013-07-16 21:59 ` [PATCH librdmacm 8/8] Open files with "close on exec" flag Yann Droneaud
7 siblings, 0 replies; 14+ messages in thread
From: Yann Droneaud @ 2013-07-16 21:59 UTC (permalink / raw)
To: Sean Hefty, linux-rdma-u79uwXL29TY76Z2rM5mHXA; +Cc: Yann Droneaud
Add the list of files/patterns to be exclueded from git status output.
Additionally it will prevent such files/patterns to be added and committed.
Signed-off-by: Yann Droneaud <ydroneaud-RlY5vtjFyJ3QT0dZR+AlfA@public.gmane.org>
---
.gitignore | 64 +++++++++++++++++++++++++++++++++++++++++++++++++++++
examples/.gitignore | 22 ++++++++++++++++++
src/.gitignore | 9 ++++++++
3 files changed, 95 insertions(+)
create mode 100644 .gitignore
create mode 100644 examples/.gitignore
create mode 100644 src/.gitignore
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..cea1f71
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,64 @@
+# - see gitignore(5)
+#
+# http://www.kernel.org/pub/software/scm/git/docs/gitignore.html
+# http://git-scm.com/docs/gitignore.html
+#
+# - ignore files in this current directory with a leading /
+# so that files with the same name is a subdirectory
+# would not be ignored by mistake.
+#
+# per directory .gitignore would be used to ignore specific
+# files/patterns
+#
+# - more examples can be found at
+#
+# https://github.com/github/gitignore
+# http://git-scm.com/book/en/Git-Basics-Recording-Changes-to-the-Repository#Ignoring-Files
+#
+
+# global ignore rules:
+#
+# backup files
+#
+*~
+
+# local (eg. current directory) rules:
+#
+# /<pattern>
+
+#
+# files created by autoreconf (autoconf, automake, libtool)
+#
+
+/INSTALL
+/config.guess
+/config.sub
+/missing
+/depcomp
+/install-sh
+/configure
+/aclocal.m4
+/autom4te.cache/
+/config.h.in
+/Makefile.in
+/compile
+/config
+
+#
+# files created by autoscan
+#
+
+/autoscan.log
+/configure.scan
+
+#
+# files created by ./configure
+#
+
+/config.h
+/config.status
+/config.log
+/Makefile
+/stamp-h1
+/libtool
+/librdmacm.spec
diff --git a/examples/.gitignore b/examples/.gitignore
new file mode 100644
index 0000000..ed17494
--- /dev/null
+++ b/examples/.gitignore
@@ -0,0 +1,22 @@
+# files produced by ./configure
+/.deps
+
+# files produced by make (libtool)
+/*.o
+/*.lo
+/*.la
+/.libs
+/.dirstamp
+
+/mckey
+/rcopy
+/rdma_client
+/rdma_server
+/rdma_xclient
+/rdma_xserver
+/riostream
+/rping
+/rstream
+/ucmatose
+/udaddy
+/udpong
diff --git a/src/.gitignore b/src/.gitignore
new file mode 100644
index 0000000..139417a
--- /dev/null
+++ b/src/.gitignore
@@ -0,0 +1,9 @@
+# files produced by ./configure
+/.deps
+
+# files produced by make (libtool)
+/*.o
+/*.lo
+/*.la
+/.libs
+/.dirstamp
--
1.8.3.1
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 14+ messages in thread* [PATCH librdmacm 7/8] Remove executable mode bit on plain text files
[not found] ` <cover.1374011243.git.ydroneaud-RlY5vtjFyJ3QT0dZR+AlfA@public.gmane.org>
` (5 preceding siblings ...)
2013-07-16 21:59 ` [PATCH librdmacm 6/8] Add .gitignore rules Yann Droneaud
@ 2013-07-16 21:59 ` Yann Droneaud
2013-07-16 21:59 ` [PATCH librdmacm 8/8] Open files with "close on exec" flag Yann Droneaud
7 siblings, 0 replies; 14+ messages in thread
From: Yann Droneaud @ 2013-07-16 21:59 UTC (permalink / raw)
To: Sean Hefty, linux-rdma-u79uwXL29TY76Z2rM5mHXA; +Cc: Yann Droneaud
Source code and man page should not be executable.
Signed-off-by: Yann Droneaud <ydroneaud-RlY5vtjFyJ3QT0dZR+AlfA@public.gmane.org>
---
include/rdma/rdma_cma.h | 0
man/rdma_accept.3 | 0
man/rdma_connect.3 | 0
man/rdma_create_qp.3 | 0
man/rdma_getaddrinfo.3 | 0
man/rdma_join_multicast.3 | 0
man/rdma_notify.3 | 0
src/acm.c | 0
src/addrinfo.c | 0
src/cma.c | 0
10 files changed, 0 insertions(+), 0 deletions(-)
mode change 100755 => 100644 include/rdma/rdma_cma.h
mode change 100755 => 100644 man/rdma_accept.3
mode change 100755 => 100644 man/rdma_connect.3
mode change 100755 => 100644 man/rdma_create_qp.3
mode change 100755 => 100644 man/rdma_getaddrinfo.3
mode change 100755 => 100644 man/rdma_join_multicast.3
mode change 100755 => 100644 man/rdma_notify.3
mode change 100755 => 100644 src/acm.c
mode change 100755 => 100644 src/addrinfo.c
mode change 100755 => 100644 src/cma.c
diff --git a/include/rdma/rdma_cma.h b/include/rdma/rdma_cma.h
old mode 100755
new mode 100644
diff --git a/man/rdma_accept.3 b/man/rdma_accept.3
old mode 100755
new mode 100644
diff --git a/man/rdma_connect.3 b/man/rdma_connect.3
old mode 100755
new mode 100644
diff --git a/man/rdma_create_qp.3 b/man/rdma_create_qp.3
old mode 100755
new mode 100644
diff --git a/man/rdma_getaddrinfo.3 b/man/rdma_getaddrinfo.3
old mode 100755
new mode 100644
diff --git a/man/rdma_join_multicast.3 b/man/rdma_join_multicast.3
old mode 100755
new mode 100644
diff --git a/man/rdma_notify.3 b/man/rdma_notify.3
old mode 100755
new mode 100644
diff --git a/src/acm.c b/src/acm.c
old mode 100755
new mode 100644
diff --git a/src/addrinfo.c b/src/addrinfo.c
old mode 100755
new mode 100644
diff --git a/src/cma.c b/src/cma.c
old mode 100755
new mode 100644
--
1.8.3.1
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 14+ messages in thread* [PATCH librdmacm 8/8] Open files with "close on exec" flag
[not found] ` <cover.1374011243.git.ydroneaud-RlY5vtjFyJ3QT0dZR+AlfA@public.gmane.org>
` (6 preceding siblings ...)
2013-07-16 21:59 ` [PATCH librdmacm 7/8] Remove executable mode bit on plain text files Yann Droneaud
@ 2013-07-16 21:59 ` Yann Droneaud
7 siblings, 0 replies; 14+ messages in thread
From: Yann Droneaud @ 2013-07-16 21:59 UTC (permalink / raw)
To: Sean Hefty, linux-rdma-u79uwXL29TY76Z2rM5mHXA; +Cc: Yann Droneaud
File opened by librdmacm are not supposed to be inherited across
exec*(), most of the files are of no use for another program, and
others cannot be used without the associated memory mapping.
This patch changes fopen() open() and socket() to always set
close on exec flag.
This patch also add checks to configure to guess if fopen() supports
"e" flag. If O_CLOEXEC and SOCK_CLOEXEC are supported, fopen() should
support "e". If not supported, its discarded according to POSIX. Many
operating systems have support for fopen("e").
You might find more information about close on exec in the following articles:
- "Excuse me son, but your code is leaking !!!" by Dan Walsh
http://danwalsh.livejournal.com/53603.html
- "Secure File Descriptor Handling" by Ulrich Drepper
http://udrepper.livejournal.com/20407.html
Note: this patch won't set close on exec flag on file descriptors
created by the kernel for completion channel and such.
This is addressed by another kernel patch.
Signed-off-by: Yann Droneaud <ydroneaud-RlY5vtjFyJ3QT0dZR+AlfA@public.gmane.org>
---
configure.ac | 24 ++++++++++++++++++++++++
src/acm.c | 4 ++--
src/cma.c | 2 +-
3 files changed, 27 insertions(+), 3 deletions(-)
diff --git a/configure.ac b/configure.ac
index 807470f..31b1a0e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -78,6 +78,30 @@ AC_CHECK_HEADER(infiniband/acm.h,
AC_DEFINE(DEFINE_ACM_MSG, 1, [adding ACM message definition]),
[#include <infiniband/acm.h>]), [])
+dnl Checks close on exec support
+AC_CHECK_HEADERS([fcntl.h sys/socket.h])
+
+AC_CHECK_DECLS([O_CLOEXEC],,[AC_DEFINE([O_CLOEXEC],[0], [Defined to 0 if not provided])],
+[[
+#ifdef HAVE_FCNTL_H
+# include <fcntl.h>
+#endif
+]])
+AC_CHECK_DECLS([SOCK_CLOEXEC],,[AC_DEFINE([SOCK_CLOEXEC],[0],[Defined to 0 if not provided])],
+[[
+#ifdef HAVE_SYS_SOCKET_H
+# include <sys/socket.h>
+#endif
+]])
+
+AC_CACHE_CHECK(for close on exec modifier for fopen(), ac_cv_feature_stream_cloexec_flag,
+ [if test $ac_cv_have_decl_O_CLOEXEC = yes ; then
+ if test $ac_cv_have_decl_SOCK_CLOEXEC = yes ; then
+ ac_cv_feature_stream_cloexec_flag="e"
+ fi
+ fi])
+AC_DEFINE_UNQUOTED([STREAM_CLOEXEC], "$ac_cv_feature_stream_cloexec_flag", [fopen() modifier for setting close on exec flag])
+
AC_CACHE_CHECK(whether ld accepts --version-script, ac_cv_version_script,
if test -n "`$LD --help < /dev/null 2>/dev/null | grep version-script`"; then
ac_cv_version_script=yes
diff --git a/src/acm.c b/src/acm.c
index c9ca5b5..6e8e173 100644
--- a/src/acm.c
+++ b/src/acm.c
@@ -80,7 +80,7 @@ static int ucma_set_server_port(void)
{
FILE *f;
- if ((f = fopen("/var/run/ibacm.port", "r"))) {
+ if ((f = fopen("/var/run/ibacm.port", "r" STREAM_CLOEXEC))) {
fscanf(f, "%hu", (unsigned short *) &server_port);
fclose(f);
}
@@ -100,7 +100,7 @@ void ucma_ib_init(void)
if (!ucma_set_server_port())
goto out;
- sock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
+ sock = socket(AF_INET, SOCK_STREAM | SOCK_CLOEXEC, IPPROTO_TCP);
if (sock < 0)
goto out;
diff --git a/src/cma.c b/src/cma.c
index 2fb9913..baebecd 100644
--- a/src/cma.c
+++ b/src/cma.c
@@ -328,7 +328,7 @@ struct rdma_event_channel *rdma_create_event_channel(void)
if (!channel)
return NULL;
- channel->fd = open("/dev/infiniband/rdma_cm", O_RDWR);
+ channel->fd = open("/dev/infiniband/rdma_cm", O_RDWR | O_CLOEXEC);
if (channel->fd < 0) {
fprintf(stderr, PFX "Fatal: unable to open /dev/infiniband/rdma_cm\n");
goto err;
--
1.8.3.1
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 14+ messages in thread