Merge pull request #1091 from rajasec/ps-errors

ps error logging improvement
This commit is contained in:
Qiang Huang 2016-10-19 11:11:41 +08:00 committed by GitHub
commit 19ab304367
1 changed files with 3 additions and 2 deletions

5
ps.go
View File

@ -51,9 +51,10 @@ var psCommand = cli.Command{
psArgs = []string{"-ef"}
}
output, err := exec.Command("ps", psArgs...).Output()
cmd := exec.Command("ps", psArgs...)
output, err := cmd.CombinedOutput()
if err != nil {
return err
return fmt.Errorf("%s: %s", err, output)
}
lines := strings.Split(string(output), "\n")