mirror of
https://codeberg.org/icewind/SMB.git
synced 2026-06-04 01:34:07 +02:00
Changed from try/catch to if(function_exists())
This commit is contained in:
parent
3a75f15ca3
commit
0cfbf33671
1 changed files with 7 additions and 9 deletions
|
|
@ -149,17 +149,15 @@ class RawConnection {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if ($terminate) {
|
if ($terminate) {
|
||||||
|
// if for case that posix_ functions are not available
|
||||||
|
if (function_exists('posix_kill')) {
|
||||||
$status = proc_get_status($this->process);
|
$status = proc_get_status($this->process);
|
||||||
$ppid = $status['pid'];
|
$ppid = $status['pid'];
|
||||||
$pids = preg_split('/\s+/', `ps -o pid --no-heading --ppid $ppid`);
|
$pids = preg_split('/\s+/', `ps -o pid --no-heading --ppid $ppid`);
|
||||||
foreach($pids as $pid) {
|
foreach($pids as $pid) {
|
||||||
if(is_numeric($pid)) {
|
if(is_numeric($pid)) {
|
||||||
// try for case that posix_ functions are not available
|
|
||||||
try {
|
|
||||||
//9 is the SIGKILL signal
|
//9 is the SIGKILL signal
|
||||||
posix_kill($pid, 9);
|
posix_kill($pid, 9);
|
||||||
} catch (\Exception $e) {
|
|
||||||
throw $e;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue