提交 bd3c897e 编写于 作者: A antirez

anet.c: save some vertical space.

上级 d83dca4c
......@@ -237,18 +237,11 @@ static int anetTcpGenericConnect(char *err, char *addr, int port, int flags)
continue;
/* if we set err then goto cleanup, otherwise next */
if (anetSetReuseAddr(err,s) == ANET_ERR) {
goto error;
}
if (flags & ANET_CONNECT_NONBLOCK) {
if (anetNonBlock(err,s) != ANET_OK)
if (anetSetReuseAddr(err,s) == ANET_ERR) goto error;
if (flags & ANET_CONNECT_NONBLOCK && anetNonBlock(err,s) != ANET_OK)
goto error;
}
if (connect(s,p->ai_addr,p->ai_addrlen) == -1) {
if (errno == EINPROGRESS &&
flags & ANET_CONNECT_NONBLOCK)
goto end;
if (errno == EINPROGRESS && flags & ANET_CONNECT_NONBLOCK) goto end;
close(s);
continue;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册