From fde18e485ff7cbc7b2e33dade8e81136f06a5b60 Mon Sep 17 00:00:00 2001 From: "Kali Kaneko (leap communications)" Date: Thu, 8 Aug 2019 00:19:33 +0200 Subject: [pkg] remove vendor --- vendor/github.com/mitchellh/go-ps/process_linux.go | 35 ---------------------- 1 file changed, 35 deletions(-) delete mode 100644 vendor/github.com/mitchellh/go-ps/process_linux.go (limited to 'vendor/github.com/mitchellh/go-ps/process_linux.go') diff --git a/vendor/github.com/mitchellh/go-ps/process_linux.go b/vendor/github.com/mitchellh/go-ps/process_linux.go deleted file mode 100644 index c1558f7..0000000 --- a/vendor/github.com/mitchellh/go-ps/process_linux.go +++ /dev/null @@ -1,35 +0,0 @@ -// +build linux - -package ps - -import ( - "fmt" - "io/ioutil" - "strings" -) - -// Refresh reloads all the data associated with this process. -func (p *UnixProcess) Refresh() error { - statPath := fmt.Sprintf("/proc/%d/stat", p.pid) - dataBytes, err := ioutil.ReadFile(statPath) - if err != nil { - return err - } - - // First, parse out the image name - data := string(dataBytes) - binStart := strings.IndexRune(data, '(') + 1 - binEnd := strings.IndexRune(data[binStart:], ')') - p.binary = data[binStart : binStart+binEnd] - - // Move past the image name and start parsing the rest - data = data[binStart+binEnd+2:] - _, err = fmt.Sscanf(data, - "%c %d %d %d", - &p.state, - &p.ppid, - &p.pgrp, - &p.sid) - - return err -} -- cgit v1.2.3