pinokiod 8.3.3 → 8.3.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/kernel/anywhere/index.js +4 -1
- package/package.json +1 -1
package/kernel/anywhere/index.js
CHANGED
|
@@ -344,7 +344,10 @@ class Anywhere {
|
|
|
344
344
|
catch (e) { if (e.code === 'ENOENT') return null; throw e }
|
|
345
345
|
if (!Number.isInteger(pid) || pid <= 0) return null
|
|
346
346
|
try { process.kill(pid, 0) }
|
|
347
|
-
catch (e) {
|
|
347
|
+
catch (e) {
|
|
348
|
+
if (e.code === 'ESRCH') return null
|
|
349
|
+
if (e.code !== 'EPERM') throw e
|
|
350
|
+
}
|
|
348
351
|
return { pid, file: this.platform === 'win32' ? 'powershell.exe' : '/bin/ps',
|
|
349
352
|
args: this.platform === 'win32' ? ['-NoProfile', '-NonInteractive', '-Command',
|
|
350
353
|
`[Console]::OutputEncoding=[Text.Encoding]::UTF8; (Get-CimInstance Win32_Process -Filter 'ProcessId=${pid}').CommandLine`]
|