Use correct type for getsockopt()

master
Kristján Valur Jónsson 2021-04-08 10:03:22 +00:00 committed by michael-grunder
parent 5e002bc21c
commit 94c1985bde
1 changed files with 2 additions and 2 deletions

4
net.c
View File

@ -281,8 +281,8 @@ int redisCheckConnectDone(redisContext *c, int *completed) {
if (error == EINPROGRESS)
{
/* must check error to see if connect failed. Get the socket error */
int fail, so_error, optlen;
optlen = sizeof(so_error);
int fail, so_error;
socklen_t optlen = sizeof(so_error);
fail = getsockopt(c->fd, SOL_SOCKET, SO_ERROR, &so_error, &optlen);
if (fail == 0) {
if (so_error == 0) {