Skip to content

Commit

Permalink
Ensure that a valid PID is passed to kill().
Browse files Browse the repository at this point in the history
  • Loading branch information
s-ludwig committed Aug 22, 2019
1 parent 44d5d1e commit 7689219
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion source/eventcore/drivers/posix/processes.d
Expand Up @@ -158,7 +158,10 @@ final class PosixEventDriverProcesses(Loop : PosixEventLoop) : EventDriverProces
@trusted {
import core.sys.posix.signal : pkill = kill;

pkill(cast(int)pid, signal);
assert(cast(int)pid > 0, "Invalid PID passed to kill.");

if (cast(int)pid > 0)
pkill(cast(int)pid, signal);
}

final override size_t wait(ProcessID pid, ProcessWaitCallback on_process_exit)
Expand Down

0 comments on commit 7689219

Please sign in to comment.