summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMilind Changire <mchangir@redhat.com>2018-10-13 10:15:42 +0530
committerAmar Tumballi <amarts@redhat.com>2018-10-16 06:33:47 +0000
commit593bbb28d95d1ebf11aa6f4d1f256529ed2dba88 (patch)
tree1904abea2427236dac0a01db192a4f3bfda29ea0
parent98f68cf115a30a101d3be2252ecbe1391720ed88 (diff)
libglusterfs: fix sys_socket coverity issue
CID 1396081: Control flow issues (UNREACHABLE) Change-Id: Ifad303853224cb9abc91c1083bb1529f4c13b1d3 updates: bz#789278 Signed-off-by: Milind Changire <mchangir@redhat.com>
-rw-r--r--libglusterfs/src/syscall.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libglusterfs/src/syscall.c b/libglusterfs/src/syscall.c
index b28f2b9d17d..0987a8628c2 100644
--- a/libglusterfs/src/syscall.c
+++ b/libglusterfs/src/syscall.c
@@ -733,13 +733,14 @@ sys_socket(int domain, int type, int protocol)
{
#ifdef SOCK_CLOEXEC
return socket(domain, type | SOCK_CLOEXEC, protocol);
-#endif
+#else
int fd = -1;
fd = socket(domain, type, protocol);
if (fd >= 0)
fcntl(fd, F_SETFD, FD_CLOEXEC);
return fd;
+#endif
}
#if (defined(HAVE_ACCEPT4) || defined(HAVE_PACCEPT))