(file) Return to main.c CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Executor

Diff for /pegasus/src/Executor/main.c between version 1.3 and 1.4

version 1.3, 2007/05/30 20:41:27 version 1.4, 2007/06/12 18:19:46
Line 79 
Line 79 
 /* /*
 **============================================================================== **==============================================================================
 ** **
 ** ReadPidFile()  
 **  
 **==============================================================================  
 */  
   
 static int ReadPidFile(const char* path, int* pid)  
 {  
     FILE* is = fopen(path, "r");  
   
     if (!is)  
         return -1;  
   
     *pid = 0;  
   
     fscanf(is, "%d\n", pid);  
     fclose(is);  
   
     if (*pid == 0)  
         return -1;  
   
     return 0;  
 }  
   
 /*  
 **==============================================================================  
 **  
 ** TestCimServerProcess()  
 **  
 **     Returns 0 if cimserver process is running.  
 **  
 **==============================================================================  
 */  
   
 int TestCimServerProcess()  
 {  
     int pid;  
     char name[EXECUTOR_BUFFER_SIZE];  
   
     if (ReadPidFile(PEGASUS_CIMSERVER_START_FILE, &pid) != 0)  
         return -1;  
   
     if (GetProcessName(pid, name) != 0 || strcmp(name, CIMSERVERMAIN) != 0)  
         return -1;  
   
     return 0;  
 }  
   
 /*  
 **==============================================================================  
 **  
 ** ExecShutdown() ** ExecShutdown()
 ** **
 **============================================================================== **==============================================================================
Line 345 
Line 295 
  
     if (options.dump)     if (options.dump)
     {     {
         DumpPolicy(1);          DumpPolicy(stdout, 1);
         DumpMacros();          DumpMacros(stdout);
         exit(0);         exit(0);
     }     }
  
Line 360 
Line 310 
      * passed through to CIMSERVERMAIN).      * passed through to CIMSERVERMAIN).
      */      */
  
     if (!options.version && !options.help && TestCimServerProcess() == 0)      if (!options.version &&
           !options.help &&
           TestProcessRunning(PEGASUS_CIMSERVER_START_FILE, CIMSERVERMAIN) == 0)
     {     {
         fprintf(stderr,         fprintf(stderr,
             "%s: cimserver is already running (the PID found in the file "             "%s: cimserver is already running (the PID found in the file "
Line 389 
Line 341 
  
     CloseOnExec(pair[1]);     CloseOnExec(pair[1]);
  
     /* Get the log-level from the configuration parameter. */      /* Initialize the log-level from the configuration parameter. */
  
     GetLogLevel(argc, argv);      InitLogLevel();
  
     /* Open the log. */     /* Open the log. */
  


Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2