When compiled on rhel 5.5, the build fails due to a missing
SOCK_CLOEXEC flag that is not available in the downstream kernel.
This patch corrects this error by checking to see if the flag is
present before using it
Signed-off-by: Allison Henderson <achender@linux.vnet.ibm.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
if (fd == RPC_ANYSOCK) {
static int have_cloexec;
fd = __rpc_nconf2fd_flags(nconf, flags);
+#ifdef SOCK_CLOEXEC
if (fd == -1) {
if ((flags & SOCK_CLOEXEC) && have_cloexec <= 0) {
fd = __rpc_nconf2fd(nconf);
goto syserror;
} else if (flags & SOCK_CLOEXEC)
have_cloexec = 1;
+#else
+ if (fd == -1)
+ goto syserror;
+#endif
madefd = TRUE;
}