ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/cms/source/ihost/ihost.c
(Generate patch)

Comparing projects/cms/source/ihost/ihost.c (file contents):
Revision 1.37 by pajs, Mon Mar 10 16:01:09 2003 UTC vs.
Revision 1.40 by pajs, Sun Apr 6 12:08:37 2003 UTC

# Line 31 | Line 31
31   #include <stdarg.h>
32   #include <errno.h>
33   #include <netdb.h>
34 + #include <netinet/in.h>
35  
36 < #include "ukcprog.h"
37 < #include "statgrab.h"
36 > #include <ukcprog.h>
37 > #include <statgrab.h>
38  
39   #define LOG_CRIT 0
40   #define LOG_ERR 1
# Line 223 | Line 224 | FILE *create_tcp_connection(char *hostname, int port){
224  
225          if((get_host_addr(hostname, &haddr))!=0){
226                  log_msg(LOG_CRIT, "Failed to lookup name for %s", hostname);
227 +                close(sock);
228                  return NULL;
229          }
230  
# Line 234 | Line 236 | FILE *create_tcp_connection(char *hostname, int port){
236          log_msg(LOG_DEBUG, "Creating a tcp connection");
237          if(connect(sock, (struct sockaddr *)&addr, sizeof(addr)) !=0){
238                  log_msg(LOG_CRIT, "Failed to connect to hostname %s on port %d", hostname, port);
239 +                close(sock);
240                  return NULL;
241          }
242  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines