Lib: check return value of select()

fixes CID 27700 found by Coverity
This commit is contained in:
Christian Beer 2015-11-04 16:34:53 +01:00
parent 230af4a5df
commit 3320af26e1
1 changed files with 4 additions and 1 deletions

View File

@ -204,7 +204,10 @@ int RPC_CLIENT::init_poll() {
BOINCTRACE("init_poll(): sock = %d\n", sock);
tv.tv_sec = tv.tv_usec = 0;
select(FD_SETSIZE, &read_fds, &write_fds, &error_fds, &tv);
if (-1 == select(FD_SETSIZE, &read_fds, &write_fds, &error_fds, &tv)) {
BOINCTRACE("init_poll(): select(): %s (%d)\n", strerror(errno), errno);
return ERR_SELECT;
}
retval = 0;
if (FD_ISSET(sock, &error_fds)) {
retval = ERR_CONNECT;