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

Function signalProcessTree

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

Source from the content-addressed store, hash-verified

83 * listening on its port.
84 */
85export function signalProcessTree(proc, signal) {
86 if (!isProcessRunning(proc)) {
87 return false;
88 }
89
90 try {
91 if (process.platform === "win32" && proc.pid) {
92 killWindowsProcessTree(proc, signal);
93 } else if (!proc.pid) {
94 proc.kill(signal);
95 } else {
96 process.kill(-proc.pid, signal);
97 }
98 return true;
99 } catch (err) {
100 if (err?.code === "ESRCH") {
101 return false;
102 }
103 throw err;
104 }
105}
106
107/**
108 * 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