Browse code

Show proper error messages

Shawn Webb authored on 2014/05/22 07:20:22
Showing 1 changed files
... ...
@@ -105,6 +105,7 @@ int dconnect() {
105 105
         hints.ai_flags = AI_PASSIVE;
106 106
 
107 107
         if ((res = getaddrinfo(ipaddr, port, &hints, &info))) {
108
+            logg("!Could not lookup %s: %s\n", opt->strarg, gai_strerror(res));
108 109
             opt = opt->nextarg;
109 110
             continue;
110 111
         }
... ...
@@ -116,6 +117,7 @@ int dconnect() {
116 116
             }
117 117
 
118 118
             if(connect(sockd, p->ai_addr, p->ai_addrlen) < 0) {
119
+                logg("!Could not connect to clamd on %s: %s\n", opt->strarg, strerror(errno));
119 120
                 closesocket(sockd);
120 121
                 continue;
121 122
             }