(file) Return to ServerProcessUnix.cpp CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Service

Diff for /pegasus/src/Service/ServerProcessUnix.cpp between version 1.11 and 1.11.18.2

version 1.11, 2006/08/09 21:13:11 version 1.11.18.2, 2007/04/18 11:46:29
Line 39 
Line 39 
 #include <sys/stat.h> #include <sys/stat.h>
 #if defined(PEGASUS_OS_HPUX) #if defined(PEGASUS_OS_HPUX)
 #include <sys/pstat.h> #include <sys/pstat.h>
   #include <libgen.h>
 #endif #endif
 #include <fcntl.h> #include <fcntl.h>
 #include <unistd.h> #include <unistd.h>
Line 296 
Line 297 
     buf.ps_pathptr   =(char *) malloc(buf.ps_pathlen   =PS_PATHBLEN);     buf.ps_pathptr   =(char *) malloc(buf.ps_pathlen   =PS_PATHBLEN);
     buf.ps_cmdptr    =(char *) malloc(buf.ps_cmdlen    =PS_CMDBLEN);     buf.ps_cmdptr    =(char *) malloc(buf.ps_cmdlen    =PS_CMDBLEN);
  
     token = w_getpsent(token, &buf, sizeof(buf));      while((token = w_getpsent(token, &buf, sizeof(buf))) > 0)
     do {      {
         token = w_getpsent(token, &buf, sizeof(buf));          if (buf.ps_pid==pid)
         if (buf.ps_pid==pid) {          {
               // If the process id is associated with the program
               // "cimserver", then a cimserver is still running.
               if (strstr(buf.ps_pathptr,"cimserver")!= NULL )
               {
             free(buf.ps_conttyptr);             free(buf.ps_conttyptr);
             free(buf.ps_pathptr);             free(buf.ps_pathptr);
             free(buf.ps_cmdptr);             free(buf.ps_cmdptr);
             return true;             return true;
         }         }
     } while(token>0);              // pid found was not associated with a cimserver
               break;
           }
       }
  
     free(buf.ps_conttyptr);     free(buf.ps_conttyptr);
     free(buf.ps_pathptr);     free(buf.ps_pathptr);
Line 435 
Line 443 
   int ret_code;   int ret_code;
   ret_code = pstat_getproc(&pstru, sizeof(struct pst_status), (size_t)0, pid);   ret_code = pstat_getproc(&pstru, sizeof(struct pst_status), (size_t)0, pid);
  
   if ( (ret_code != -1 ) && (strcmp(pstru.pst_ucomm, getProcessName())) == 0)    if (ret_code != -1)
     {
         //
         // Gets the command basename disregarding the command parameters
         //
         char *execName = strchr(pstru.pst_cmd,' ');
         if (execName)
         {
             *execName = '\0';
         }
         execName = basename(pstru.pst_cmd);
   
         if (strcmp(execName, getProcessName()) == 0)
   {   {
       //       //
       // Check to see if this command process has the same pid as the       // Check to see if this command process has the same pid as the
Line 451 
Line 471 
           return true;           return true;
       }       }
   }   }
     }
 #endif #endif
 #if defined(PEGASUS_PLATFORM_LINUX_GENERIC_GNU) || defined(PEGASUS_OS_SOLARIS) #if defined(PEGASUS_PLATFORM_LINUX_GENERIC_GNU) || defined(PEGASUS_OS_SOLARIS)
   if (get_proc(pid) != -1 )   if (get_proc(pid) != -1 )


Legend:
Removed from v.1.11  
changed lines
  Added in v.1.11.18.2

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2