(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.16.7 and 1.12

version 1.11.16.7, 2006/12/29 22:22:04 version 1.12, 2007/02/15 16:42:26
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 119 
Line 120 
  
 int ServerProcess::cimserver_fork(void) int ServerProcess::cimserver_fork(void)
 { {
 #if defined(PEGASUS_ENABLE_PRIVILEGE_SEPARATION)  
   
     getSigHandle()->registerHandler(SIGTERM, sigTermHandler);  
     getSigHandle()->activate(SIGTERM);  
     server_pid = getpid();  
   
     return 0;  
   
 #else /* !defined(PEGASUS_ENABLE_PRIVILEGE_SEPARATION) */  
   
     getSigHandle()->registerHandler(PEGASUS_SIGUSR1, sigUsr1Handler);     getSigHandle()->registerHandler(PEGASUS_SIGUSR1, sigUsr1Handler);
     getSigHandle()->activate(PEGASUS_SIGUSR1);     getSigHandle()->activate(PEGASUS_SIGUSR1);
     getSigHandle()->registerHandler(SIGTERM, sigTermHandler);     getSigHandle()->registerHandler(SIGTERM, sigTermHandler);
Line 174 
Line 165 
   // get the pid of the cimserver process   // get the pid of the cimserver process
   server_pid = getpid();   server_pid = getpid();
   return(0);   return(0);
   
 #endif /* !defined(PEGASUS_ENABLE_PRIVILEGE_SEPARATION) */  
 } }
  
 long ServerProcess::get_server_pid() long ServerProcess::get_server_pid()
Line 447 
Line 436 
   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 463 
Line 464 
           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.16.7  
changed lines
  Added in v.1.12

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2