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.18 by pajs, Tue May 21 14:07:32 2002 UTC vs.
Revision 1.19 by pajs, Tue May 21 14:23:31 2002 UTC

# Line 36 | Line 36
36   #define versionNo 0.8
37   #define RECONFIGURE_RETURN_CODE 2
38   #define UDP_MAX_PACKET_SIZE 8192
39 + #define PID_FILE "/var/tmp/.ihost.pid"
40  
41   #define logmessage(level, ...) do { cur_level = level; errf(__VA_ARGS__); } while (0)
42  
# Line 485 | Line 486 | int main(int argc, char **argv){
486          extern int syslog_logging;
487          extern int log_level;
488          extern int cur_level;
489 +        FILE *f;
490  
491          log_level=1;
492          cur_level=1;
# Line 585 | Line 587 | int main(int argc, char **argv){
587                          /* Print out everything its doing */
588                          log_level=LOG_DEBUG;
589                          break;
590 +        }
591 +
592 +        logmessage(LOG_DEBUG,"Writing PID FILE");
593 +        pid=getpid();
594 +        if((f=fopen(PID_FILE,"w")) == NULL){
595 +                logmessage(LOG_WARNING, "Failed to write PID file");
596 +        }else{
597 +                if((fprintf(f,"%d",(int)pid)) != sizeof(pid)){
598 +                        logmessage(LOG_WARNING, "Failed to write PID file");
599 +                }
600 +                if((fclose(f))!=0){
601 +                        logmessage(LOG_ERR, "failed to close PID file");
602 +                        exit(1);
603 +                }
604          }
605  
606          if(ihost_configure(&ihost_state)!=0){

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines