From a75965c4c5fe88eeec4085eeb0edc761f4ddd575 Mon Sep 17 00:00:00 2001 From: Thomas Perl Date: Wed, 26 May 2010 10:48:33 +0200 Subject: [PATCH] Fix output of command line --- bwmon/proc.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bwmon/proc.py b/bwmon/proc.py index 80f3bf5..17da365 100644 --- a/bwmon/proc.py +++ b/bwmon/proc.py @@ -95,9 +95,12 @@ def get_fd_map(): else: continue - cmd_file = open(os.path.join(d, cmdline), 'r') + cmd_file = open(os.path.join(d, cmdline), 'rb') cmd = cmd_file.read() + # Command line arguments are splitted by '\0' + cmd = cmd.replace('\0', ' ') + m[inode] = {'inode': inode, 'cmd': cmd, 'pid': int(pid)} return m -- 2.11.4.GIT