From 593bbb28d95d1ebf11aa6f4d1f256529ed2dba88 Mon Sep 17 00:00:00 2001 From: Milind Changire Date: Sat, 13 Oct 2018 10:15:42 +0530 Subject: libglusterfs: fix sys_socket coverity issue CID 1396081: Control flow issues (UNREACHABLE) Change-Id: Ifad303853224cb9abc91c1083bb1529f4c13b1d3 updates: bz#789278 Signed-off-by: Milind Changire --- libglusterfs/src/syscall.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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)) -- cgit