MCPcopy Create free account
hub / github.com/bearlyai/OpenADE / signalProcess

Function signalProcess

projects/electron/src/modules/code/orphanHarness.ts:89–105  ·  view source on GitHub ↗
(pid: number, signal: NodeJS.Signals)

Source from the content-addressed store, hash-verified

87}
88
89function signalProcess(pid: number, signal: NodeJS.Signals): void {
90 // Harness processes are spawned detached as their own group leader, so the
91 // group (-pid) covers the CLI and any children it spawned.
92 try {
93 if (process.platform !== "win32") {
94 process.kill(-pid, signal)
95 return
96 }
97 } catch {
98 // Fall through to direct-pid kill if the group is already gone.
99 }
100 try {
101 process.kill(pid, signal)
102 } catch {
103 // Already exited.
104 }
105}
106
107/** Terminate the given orphan pids (SIGTERM, then SIGKILL for survivors). */
108export function killOrphanHarnessPids(pids: number[]): void {

Callers 1

killOrphanHarnessPidsFunction · 0.85

Calls 1

killMethod · 0.65

Tested by

no test coverage detected