version 1.11, 2006/08/09 21:13:11
|
version 1.12, 2007/02/15 16:42:26
|
|
|
#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> |
|
|
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 |
|
|
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 ) |