minor fix;
This commit is contained in:
parent
a0f77c91bb
commit
1cde3a1eb8
@ -2172,10 +2172,10 @@ int connection_initiate(conn_t *co, const char *host, int port,
|
|||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
host_ = gethostbyname(host);
|
host_ = gethostbyname(host);
|
||||||
#else
|
#else
|
||||||
r=__resolvehost(host, buf, __TMPBUFLEN, &host_);
|
r = __resolvehost(host, buf, __TMPBUFLEN, &host_);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if(errno) {
|
if(r) {
|
||||||
r = ENOENT;
|
r = ENOENT;
|
||||||
free(buf);
|
free(buf);
|
||||||
goto __fail_3;
|
goto __fail_3;
|
||||||
@ -2191,7 +2191,7 @@ int connection_initiate(conn_t *co, const char *host, int port,
|
|||||||
addr.sin_addr.s_addr = *(uint32_t*)(host_->h_addr);
|
addr.sin_addr.s_addr = *(uint32_t*)(host_->h_addr);
|
||||||
r=connect(sd, (struct sockaddr*)&addr, sizeof(addr));
|
r=connect(sd, (struct sockaddr*)&addr, sizeof(addr));
|
||||||
|
|
||||||
if ( r!= 0) {
|
if ( r != 0) {
|
||||||
printf("connect error %d %s \n",r, strerror(errno));
|
printf("connect error %d %s \n",r, strerror(errno));
|
||||||
close(sd);
|
close(sd);
|
||||||
free(buf);
|
free(buf);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user