You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[process][darwin][freebsd][linux][openbsd] Make process.Children not reliant on pgrep
pgrep -P $PID exits with status of 1 (and nothing in stdout nor stderr) both if
a process doesn't exist or it doesn't have child processes, so we don't
use it anymore on these OSes. We sort PIDs as pgrep did.
Also deprecate the ErrorNoChildren error when there are no child processes,
this is erroneous (simply check for the length of the returned slice, plus
this is not an error per se), this was only returned on linux anyway.
Fixes#1698
Copy file name to clipboardexpand all lines: process/process.go
+1-1
Original file line number
Diff line number
Diff line change
@@ -18,7 +18,7 @@ import (
18
18
19
19
var (
20
20
invoke common.Invoker= common.Invoke{}
21
-
ErrorNoChildren=errors.New("process does not have children")
21
+
ErrorNoChildren=errors.New("process does not have children")// Deprecated: ErrorNoChildren is never returned by process.Children(), check its returned []*Process slice length instead
22
22
ErrorProcessNotRunning=errors.New("process does not exist")
23
23
ErrorNotPermitted=errors.New("operation not permitted")
0 commit comments