vendor psgo v1.2

The psgo library now be used concurrently by multiple goroutines without
interferring with another.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
This commit is contained in:
Valentin Rothberg
2019-03-11 18:05:37 +01:00
parent 6421208e0f
commit 508ab7f565
6 changed files with 83 additions and 107 deletions

View File

@ -21,7 +21,6 @@ import (
"os/exec"
"strings"
"github.com/containers/psgo/internal/types"
"github.com/pkg/errors"
)
@ -207,11 +206,11 @@ func readStatusDefault(pid string) ([]string, error) {
}
// ParseStatus parses the /proc/$pid/status file and returns a *Status.
func ParseStatus(ctx *types.PsContext, pid string) (*Status, error) {
func ParseStatus(pid string, joinUserNS bool) (*Status, error) {
var lines []string
var err error
if ctx.JoinUserNS {
if joinUserNS {
lines, err = readStatusUserNS(pid)
} else {
lines, err = readStatusDefault(pid)