update vendor/src/github.com/syndtr/gocapability/
Signed-off-by: Andrey Vagin <avagin@openvz.org>
This commit is contained in:
parent
444cc2989a
commit
21c344a479
|
@ -60,7 +60,8 @@ type Capabilities interface {
|
|||
Apply(kind CapType) error
|
||||
}
|
||||
|
||||
// NewPid create new initialized Capabilities object for given pid.
|
||||
// NewPid create new initialized Capabilities object for given pid when it
|
||||
// is nonzero, or for the current pid if pid is 0
|
||||
func NewPid(pid int) (Capabilities, error) {
|
||||
return newPid(pid)
|
||||
}
|
||||
|
|
|
@ -351,7 +351,15 @@ func (c *capsV3) Load() (err error) {
|
|||
return
|
||||
}
|
||||
|
||||
f, err := os.Open(fmt.Sprintf("/proc/%d/status", c.hdr.pid))
|
||||
var status_path string
|
||||
|
||||
if c.hdr.pid == 0 {
|
||||
status_path = fmt.Sprintf("/proc/self/status")
|
||||
} else {
|
||||
status_path = fmt.Sprintf("/proc/%d/status", c.hdr.pid)
|
||||
}
|
||||
|
||||
f, err := os.Open(status_path)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue