(file) Return to cimserver_unix.cpp CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Server / Attic

Diff for /pegasus/src/Server/Attic/cimserver_unix.cpp between version 1.18 and 1.19

version 1.18, 2003/05/07 18:48:16 version 1.19, 2003/05/21 11:32:22
Line 25 
Line 25 
 // //
 // Modified By:  Jenny Yu, Hewlett-Packard Company (jenny_yu@hp.com) // Modified By:  Jenny Yu, Hewlett-Packard Company (jenny_yu@hp.com)
 //               Yi Zhou, Hewlett-Packard Company (yi_zhou@hp.com) //               Yi Zhou, Hewlett-Packard Company (yi_zhou@hp.com)
 //  //       Marek Szermutzky, IBM (ddt6szer@de.ibm.com)
 //%///////////////////////////////////////////////////////////////////////////// //%/////////////////////////////////////////////////////////////////////////////
  
 #include <sys/types.h> #include <sys/types.h>
Line 36 
Line 36 
 #include <fcntl.h> #include <fcntl.h>
 #include <unistd.h> #include <unistd.h>
 #include <Pegasus/Common/Signal.h> #include <Pegasus/Common/Signal.h>
   #if defined(PEGASUS_PLATFORM_ZOS_ZSERIES_IBM)
   #include <sys/ps.h>
   #endif
 #define MAX_WAIT_TIME 25 #define MAX_WAIT_TIME 25
  
 PEGASUS_USING_PEGASUS; PEGASUS_USING_PEGASUS;
Line 187 
Line 189 
 } }
 #endif #endif
  
   #if defined(PEGASUS_PLATFORM_ZOS_ZSERIES_IBM)
   Boolean isProcRunning(pid_t pid)
   {
       W_PSPROC buf;
       int token = 0;
       memset(&buf, 0x00, sizeof(buf));
       buf.ps_conttyptr =(char *) malloc(buf.ps_conttylen =PS_CONTTYBLEN);
       buf.ps_pathptr   =(char *) malloc(buf.ps_pathlen   =PS_PATHBLEN);
       buf.ps_cmdptr    =(char *) malloc(buf.ps_cmdlen    =PS_CMDBLEN);
   
       token = w_getpsent(token, &buf, sizeof(buf));
       do {
           token = w_getpsent(token, &buf, sizeof(buf));
           if (buf.ps_pid==pid) {
               free(buf.ps_conttyptr);
               free(buf.ps_pathptr);
               free(buf.ps_cmdptr);
               return true;
           }
       } while(token>0);
   
       free(buf.ps_conttyptr);
       free(buf.ps_pathptr);
       free(buf.ps_cmdptr);
       return false;
   }
   #endif
  
 Boolean isCIMServerRunning(void) Boolean isCIMServerRunning(void)
 { {
Line 194 
Line 223 
   pid_t pid = 0;   pid_t pid = 0;
  
   // open the file containing the CIMServer process ID   // open the file containing the CIMServer process ID
   pid_file = fopen(CIMSERVER_START_FILE, "rw");    pid_file = fopen(CIMSERVER_START_FILE, "r");
   if (!pid_file)   if (!pid_file)
   {   {
       return false;       return false;
Line 232 
Line 261 
       return true;       return true;
   }   }
 #endif #endif
   #if defined(PEGASUS_PLATFORM_ZOS_ZSERIES_IBM)
       return isProcRunning(pid);
   #endif
   return false;   return false;
 } }
  
Line 280 
Line 311 
       kill(pid, SIGKILL);       kill(pid, SIGKILL);
   }   }
 #endif #endif
   #if defined(PEGASUS_PLATFORM_ZOS_ZSERIES_IBM)
     if (isProcRunning(pid)) {
         kill(pid, SIGKILL);
     }
   #endif
   // remove the file   // remove the file
   System::removeFile(CIMSERVER_START_FILE);   System::removeFile(CIMSERVER_START_FILE);
  


Legend:
Removed from v.1.18  
changed lines
  Added in v.1.19

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2