kill(): fix bug when running with POSIX extension but without pcntl

SIGKILL constant is defined by pcntl, not by posix. If pcntl is not compiled then bugs can occur when trying to kill() the server (such as during a crash).
This commit is contained in:
Dylan K. Taylor 2018-02-06 17:55:18 +00:00
parent 4eea54780a
commit 75289b1498

View File

@ -377,7 +377,7 @@ namespace pocketmine {
case "linux":
default:
if(function_exists("posix_kill")){
posix_kill($pid, SIGKILL);
posix_kill($pid, 9); //SIGKILL
}else{
exec("kill -9 " . ((int) $pid) . " > /dev/null 2>&1");
}