mirror of
http://github.com/valkey-io/valkey
synced 2024-11-23 11:51:01 +00:00
anet.c: save some vertical space.
This commit is contained in:
parent
d83dca4c79
commit
bd3c897e9f
13
src/anet.c
13
src/anet.c
@ -237,18 +237,11 @@ static int anetTcpGenericConnect(char *err, char *addr, int port, int flags)
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
/* if we set err then goto cleanup, otherwise next */
|
/* if we set err then goto cleanup, otherwise next */
|
||||||
if (anetSetReuseAddr(err,s) == ANET_ERR) {
|
if (anetSetReuseAddr(err,s) == ANET_ERR) goto error;
|
||||||
|
if (flags & ANET_CONNECT_NONBLOCK && anetNonBlock(err,s) != ANET_OK)
|
||||||
goto error;
|
goto error;
|
||||||
}
|
|
||||||
if (flags & ANET_CONNECT_NONBLOCK) {
|
|
||||||
if (anetNonBlock(err,s) != ANET_OK)
|
|
||||||
goto error;
|
|
||||||
}
|
|
||||||
if (connect(s,p->ai_addr,p->ai_addrlen) == -1) {
|
if (connect(s,p->ai_addr,p->ai_addrlen) == -1) {
|
||||||
if (errno == EINPROGRESS &&
|
if (errno == EINPROGRESS && flags & ANET_CONNECT_NONBLOCK) goto end;
|
||||||
flags & ANET_CONNECT_NONBLOCK)
|
|
||||||
goto end;
|
|
||||||
|
|
||||||
close(s);
|
close(s);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user