Fixes to Coverity defects:

72643
72645
72655
72656
72657
72658
72664
72698
72712
This commit is contained in:
Markus Makela
2014-11-12 19:02:37 +02:00
parent b5445bdf63
commit fc5c3943e8
6 changed files with 89 additions and 34 deletions

View File

@ -358,7 +358,8 @@ telnetd_listen(DCB *listener, char *config)
{
struct sockaddr_in addr;
int one = 1;
int rc;
int rc;
int syseno = 0;
memcpy(&listener->func, &MyObject, sizeof(GWPROTOCOL));
@ -372,7 +373,12 @@ int rc;
}
// socket options
setsockopt(listener->fd, SOL_SOCKET, SO_REUSEADDR, (char *)&one, sizeof(one));
syseno = setsockopt(listener->fd, SOL_SOCKET, SO_REUSEADDR, (char *)&one, sizeof(one));
if(syseno != 0){
LOGIF(LE, (skygw_log_write_flush(LOGFILE_ERROR,"Error: Failed to set socket options. Error %d: %s",syseno,strerror(syseno))));
return 0;
}
// set NONBLOCKING mode
setnonblocking(listener->fd);
// bind address and port