Skip to content
Snippets Groups Projects
Commit e0f415e1 authored by deuce's avatar deuce
Browse files

If select() returns an error, return it rather than forcing the return value

to zero.
parent 39004fda
No related branches found
No related tags found
No related merge requests found
......@@ -238,10 +238,8 @@ static ptrdiff_t js_socket_recv(js_socket_private_t *p, void *buf, size_t len, i
FD_ZERO(&socket_set);
FD_SET(p->sock,&socket_set);
tv.tv_sec = timeout;
if(select(p->sock+1,&socket_set,NULL,NULL,&tv)==1)
if((ret = select(p->sock+1,&socket_set,NULL,NULL,&tv))==1)
ret = recv(p->sock, buf, len, flags);
else
ret = 0;
}
else {
status = cryptPopData(p->session, buf, len, &copied);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment