715 |
int is_process_running(Process_T p) { |
int is_process_running(Process_T p) { |
716 |
|
|
717 |
pid_t pid; |
pid_t pid; |
|
int kill_return= 0; |
|
718 |
|
|
719 |
ASSERT(p); |
ASSERT(p); |
720 |
|
|
722 |
|
|
723 |
if((pid= get_pid(p->pidfile))) { |
if((pid= get_pid(p->pidfile))) { |
724 |
|
|
725 |
if((kill_return= getpgid(pid)) > 0 || errno == EPERM) |
#ifdef AIX |
726 |
|
|
727 |
|
/* Comment by Richard Schwaninger <risc@vmilch.at>: */ |
728 |
|
/* hmm. I get getpgid== -1 and errno==0 sometimes... */ |
729 |
|
|
730 |
|
if(( getpgid(pid)>0 ) || ( errno == EPERM ) || ( errno == 0 )) |
731 |
|
|
732 |
|
return pid; |
733 |
|
|
734 |
|
#else |
735 |
|
|
736 |
|
if(( getpgid(pid) > 0 ) || ( errno == EPERM )) |
737 |
|
|
738 |
return pid; |
return pid; |
739 |
|
|
740 |
|
#endif |
741 |
|
|
742 |
} |
} |
743 |
|
|
744 |
|
|
745 |
memset(p->procinfo, 0, sizeof *(p->procinfo)); |
memset(p->procinfo, 0, sizeof *(p->procinfo)); |
746 |
|
|
747 |
return FALSE; |
return FALSE; |