From 1cde3a1eb85ac15fe8d689d05fe7394c6f78cbf9 Mon Sep 17 00:00:00 2001 From: Alexander Vdolainen Date: Tue, 17 Mar 2015 17:02:23 +0200 Subject: [PATCH] minor fix; --- lib/connection.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/connection.c b/lib/connection.c index 8e63c8e..7d1d268 100644 --- a/lib/connection.c +++ b/lib/connection.c @@ -2172,10 +2172,10 @@ int connection_initiate(conn_t *co, const char *host, int port, #ifdef WIN32 host_ = gethostbyname(host); #else - r=__resolvehost(host, buf, __TMPBUFLEN, &host_); + r = __resolvehost(host, buf, __TMPBUFLEN, &host_); #endif - if(errno) { + if(r) { r = ENOENT; free(buf); 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); r=connect(sd, (struct sockaddr*)&addr, sizeof(addr)); - if ( r!= 0) { + if ( r != 0) { printf("connect error %d %s \n",r, strerror(errno)); close(sd); free(buf);