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.28 by pajs, Mon Mar 3 12:18:35 2003 UTC vs.
Revision 1.30 by pajs, Mon Mar 3 17:07:34 2003 UTC

# Line 32 | Line 32
32   #include <errno.h>
33   #include <netdb.h>
34  
35 < #include <ukcprog.h>
35 > #include "ukcprog.h"
36   #include "statgrab.h"
37  
38   #define LOG_CRIT 0
# Line 40 | Line 40
40   #define LOG_INFO 2
41   #define LOG_DEBUG 3
42  
43 #define PID_FILE "/var/run/ihost.pid"
44 #define LOGFILE_PATH "/var/log/ihost.log"
45 #define VERSION ".03"
46
47 #define MAX_UDP_PACKET_SIZE 8192
48
43   typedef struct{
44          int filtermanager_port;
45          char *filtermanager_host;
# Line 226 | Line 220 | int ihost_getconfig(ihost_state_t *ihost_state){
220          int server_udp_port=0;
221          time_t config_ttl=0;
222  
223 <        tcp_con=create_tcp_connection(ihost_state->filtermanager_host, ihost_state->filtermanager_port);
223 >        if((tcp_con=create_tcp_connection(ihost_state->filtermanager_host, ihost_state->filtermanager_port))==NULL){
224 >                goto error;
225 >        }
226  
227          if(ihost_state->file_list!=NULL || ihost_state->last_modified!=NULL){
228                  if(tcp_con==NULL){
# Line 521 | Line 517 | int get_system_stats(int seq_no, ihost_state_t *ihost_
517          /* get diskio stats */
518          
519          if((diskio_stats=get_diskio_stats_diff(&diskio_entries))==NULL){
520 <                log_msg(LOG_CRIT, "Failed to get diskio statistics");
520 >                log_msg(LOG_CRIT, "Fahttp://www.cs.ukc.ac.uk/teaching/02/modules/CO/6/17/rdl/criteria.pdfiled to get diskio statistics");
521          }else{
522                  strlcat(xml, "<diskio>", size);
523                  for(counter=0;counter<diskio_entries;counter++){
# Line 682 | Line 678 | int main(int argc, char **argv){
678                                  break;
679  
680                          case 'V':
681 <                                fprintf(stderr, "%s version %s", argv[0], VERSION);
681 >                                fprintf(stderr, "%s version %s\n", argv[0], VERSION);
682                                  break;
683  
684                          default:
# Line 723 | Line 719 | int main(int argc, char **argv){
719                          exit(1);
720                  }
721          
722 <                if((ihost_config.log=fopen(LOGFILE_PATH, "a"))==NULL){
722 >                if((ihost_config.log=fopen(LOG_FILE, "a"))==NULL){
723                          ihost_config.log=stderr;
724 <                        log_msg(LOG_CRIT, "Failed to open Logfiles %s for writing", LOGFILE_PATH);
724 >                        log_msg(LOG_CRIT, "Failed to open Logfiles %s for writing", LOG_FILE);
725                          exit(1);
726                  }
727  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines