Ensure that a valid PID is passed to kill().

This commit is contained in:
Sönke Ludwig 2019-08-22 14:35:37 +02:00 committed by Sönke Ludwig
parent 01c2c26964
commit 5c3afcc175

View file

@ -158,6 +158,9 @@ final class PosixEventDriverProcesses(Loop : PosixEventLoop) : EventDriverProces
@trusted {
import core.sys.posix.signal : pkill = kill;
assert(cast(int)pid > 0, "Invalid PID passed to kill.");
if (cast(int)pid > 0)
pkill(cast(int)pid, signal);
}