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>
This commit is contained in:
Milind Changire 2018-10-13 10:15:42 +05:30 committed by Amar Tumballi
parent 98f68cf115
commit 593bbb28d9

View File

@ -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))