MCPcopy Create free account
hub / github.com/OpenHands/OpenHands / signalProcessTree

Function signalProcessTree

scripts/dev-process-utils.mjs:80–100  ·  view source on GitHub ↗
(proc, signal)

Source from the content-addressed store, hash-verified

78 * listening on its port.
79 */
80export function signalProcessTree(proc, signal) {
81 if (!isProcessRunning(proc)) {
82 return false;
83 }
84
85 try {
86 if (process.platform === "win32" && proc.pid) {
87 killWindowsProcessTree(proc, signal);
88 } else if (!proc.pid) {
89 proc.kill(signal);
90 } else {
91 process.kill(-proc.pid, signal);
92 }
93 return true;
94 } catch (err) {
95 if (err?.code === "ESRCH") {
96 return false;
97 }
98 throw err;
99 }
100}
101
102/**
103 * Windows has no POSIX process groups: ChildProcess#kill reaches only the

Callers 4

shutdownFunction · 0.90
shutdownFunction · 0.90
shutdownFunction · 0.90
shutdownFunction · 0.90

Calls 2

isProcessRunningFunction · 0.85
killWindowsProcessTreeFunction · 0.85

Tested by

no test coverage detected