@alignfirst/pi-background 0.1.3 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/process-tree.js +5 -1
- package/package.json +1 -1
package/dist/process-tree.js
CHANGED
|
@@ -143,9 +143,13 @@ function linuxProcessTable() {
|
|
|
143
143
|
.flatMap((name) => {
|
|
144
144
|
const pid = Number(name);
|
|
145
145
|
const fields = readStatFields(pid, HIDDEN_CODES);
|
|
146
|
-
return fields ? [linuxTarget(pid, fields)] : [];
|
|
146
|
+
return fields && !isReaping(fields) ? [linuxTarget(pid, fields)] : [];
|
|
147
147
|
});
|
|
148
148
|
}
|
|
149
|
+
// A task being reaped reports state X, then pgid -1 once its signal handlers are released.
|
|
150
|
+
function isReaping([state, , group]) {
|
|
151
|
+
return state === "X" || group === "-1";
|
|
152
|
+
}
|
|
149
153
|
// The fields after the command name, or undefined when the read fails with a skipped code.
|
|
150
154
|
function readStatFields(pid, skippedCodes) {
|
|
151
155
|
try {
|