Don't call strip() on process' cmdline. It shouldn't be necessary
and it alters the cmdline if e.g. argv[0] begins with whitespace.
Signed-off-by: Ondřej Lysoněk <olysonek(a)redhat.com>
---
procfs/procfs.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/procfs/procfs.py b/procfs/procfs.py
index f97668c..61f802f 100755
--- a/procfs/procfs.py
+++ b/procfs/procfs.py
@@ -32,7 +32,7 @@ def process_cmdline(pid_info):
not available, falls back to using the comm (short process name) in its pidstat key.
"""
if pid_info["cmdline"]:
- return reduce(lambda a, b: a + " %s" % b, pid_info["cmdline"]).strip()
+ return reduce(lambda a, b: a + " %s" % b, pid_info["cmdline"])
return pid_info["stat"]["comm"]
@@ -325,7 +325,7 @@ class process:
def load_cmdline(self):
f = open("/proc/%d/cmdline" % self.pid)
- self.cmdline = f.readline().strip().split('\0')[:-1]
+ self.cmdline = f.readline().split('\0')[:-1]
f.close()
def load_threads(self):
--
2.14.3