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:
rajasec 2016-09-29 09:56:07 +05:30
parent bf77e5976a
commit 528bf3718d
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")