From 3b20a0f983dbf5c60ed2e0192cad07f87081ef27 Mon Sep 17 00:00:00 2001 From: k1LoW Date: Fri, 13 Apr 2018 11:57:29 +0900 Subject: [PATCH] Fix parse out the image name ex. ((sd-pam)) on Ubuntu xenial ``` $ cat /proc/1821/stat 1821 ((sd-pam)) S 1819 1819 1819 0 -1 ... ``` --- process_linux.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/process_linux.go b/process_linux.go index c1558f7..323e7c5 100644 --- a/process_linux.go +++ b/process_linux.go @@ -19,7 +19,7 @@ func (p *UnixProcess) Refresh() error { // First, parse out the image name data := string(dataBytes) binStart := strings.IndexRune(data, '(') + 1 - binEnd := strings.IndexRune(data[binStart:], ')') + binEnd := strings.IndexRune(data[binStart:], ' ') - 1 p.binary = data[binStart : binStart+binEnd] // Move past the image name and start parsing the rest