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.24 by pajs, Tue May 21 16:55:59 2002 UTC vs.
Revision 1.25 by pajs, Wed May 22 09:01:01 2002 UTC

# Line 139 | Line 139 | int ihost_configure(ihost_state_t *ihost_state){
139                  logmessage(LOG_ERR, "sa family is wrong type");
140                  return -1;
141          }
142 <        
142 >
143 >        if(ihost_state->my_ip!=NULL) free(ihost_state->my_ip);  
144          if((ihost_state->my_ip=strdup(inet_ntoa(((struct sockaddr_in *)&ip)->sin_addr)))==NULL){
145                  logmessage(LOG_ERR, "Failed to get IP (%m)");
146                  return -1;
# Line 485 | Line 486 | int main(int argc, char **argv){
486          ihost_state.last_modified=NULL;
487          ihost_state.files_list=NULL;
488          ihost_state.key=NULL;
489 +        ihost_state.my_ip=NULL;
490  
491          errf_set_progname(argv[0]);
492          
# Line 577 | Line 579 | int main(int argc, char **argv){
579          logmessage(LOG_DEBUG,"Writing PID FILE");
580          pid=getpid();
581          if((f=fopen(PID_FILE,"w")) == NULL){
582 <                logmessage(LOG_WARNING, "Failed to write PID file");
582 >                logmessage(LOG_WARNING, "Failed to write PID file (%m)");
583          }else{
584 <                if((fprintf(f,"%d",(int)pid)) > 0 ){
585 <                        logmessage(LOG_WARNING, "Failed to write PID file");
584 >                if((fprintf(f,"%d",(int)pid)) <= 0 ){
585 >                        logmessage(LOG_WARNING, "Failed to write PID file (%m)");
586                  }
587                  if((fclose(f))!=0){
588                          logmessage(LOG_ERR, "failed to close PID file");

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines