ps error logging improvement
Signed-off-by: rajasec <rajasec79@gmail.com> ps error logging improvement Signed-off-by: rajasec <rajasec79@gmail.com>
This commit is contained in:
parent
bf77e5976a
commit
528bf3718d
5
ps.go
5
ps.go
|
@ -51,9 +51,10 @@ var psCommand = cli.Command{
|
||||||
psArgs = []string{"-ef"}
|
psArgs = []string{"-ef"}
|
||||||
}
|
}
|
||||||
|
|
||||||
output, err := exec.Command("ps", psArgs...).Output()
|
cmd := exec.Command("ps", psArgs...)
|
||||||
|
output, err := cmd.CombinedOutput()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return fmt.Errorf("%s: %s", err, output)
|
||||||
}
|
}
|
||||||
|
|
||||||
lines := strings.Split(string(output), "\n")
|
lines := strings.Split(string(output), "\n")
|
||||||
|
|
Loading…
Reference in New Issue