summaryrefslogtreecommitdiff
path: root/sal
diff options
context:
space:
mode:
authorNorbert Thiebaud <nthiebaud@gmail.com>2014-03-07 17:34:27 -0600
committerNorbert Thiebaud <nthiebaud@gmail.com>2014-03-07 20:33:59 -0600
commitae4a27bd2cb652c5d681da2f57bf63c8bc394e38 (patch)
tree64a198be1d66d3493a3d26f643816fb054538e2c /sal
parentdc563d3a4b772835d60068c81c77ffae8d11cc61 (diff)
coverity#705404: Argument cannot be negative
Change-Id: I235a5323ee0fd60aee03c691c0c7fdf6e6e4c08b
Diffstat (limited to 'sal')
-rw-r--r--sal/osl/unx/socket.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/sal/osl/unx/socket.c b/sal/osl/unx/socket.c
index 1743dc086813..1b0e7367d6bd 100644
--- a/sal/osl/unx/socket.c
+++ b/sal/osl/unx/socket.c
@@ -1446,13 +1446,15 @@ void SAL_CALL osl_closeSocket(oslSocket pSocket)
{
OSL_TRACE("socket call failed with error: %s", strerror(errno));
}
-
- nRet = connect(nConnFD, &s.aSockAddr, sizeof(s.aSockAddr));
- if ( nRet < 0 )
+ else
{
- OSL_TRACE("connect call failed with error: %s", strerror(errno));
+ nRet = connect(nConnFD, &s.aSockAddr, sizeof(s.aSockAddr));
+ if ( nRet < 0 )
+ {
+ OSL_TRACE("connect call failed with error: %s", strerror(errno));
+ }
+ close(nConnFD);
}
- close(nConnFD);
}
pSocket->m_bIsAccepting = sal_False;
}