MCPcopy Create free account
hub / github.com/delinoio/oss / signalPosixProcessGroup

Function signalPosixProcessGroup

scripts/spawn-dev-server.mjs:163–178  ·  view source on GitHub ↗
(child, processGroupId, signal)

Source from the content-addressed store, hash-verified

161}
162
163function signalPosixProcessGroup(child, processGroupId, signal) {
164 try {
165 process.kill(processGroupId, signal);
166 } catch (error) {
167 if (error.code === "ESRCH") {
168 return false;
169 }
170 if (child.exitCode === null && child.signalCode === null) {
171 child.kill(signal);
172 }
173 throw new Error(
174 `failed to terminate POSIX process group ${child.pid}: ${error.message}`,
175 );
176 }
177 return true;
178}
179
180export async function terminatePosixProcessGroup(child, signal) {
181 const processGroupId = -child.pid;

Callers 1

Calls 1

killMethod · 0.80

Tested by

no test coverage detected