From dac2d948248567c3c7eaac913152e1f8f0154308 Mon Sep 17 00:00:00 2001 From: Guillaume Chazarain Date: Wed, 5 Mar 2008 22:14:19 +0100 Subject: [PATCH] Reading the cmdline of a dead process raises an exception too. Reported by Roland Kletzing --- iotop.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iotop.py b/iotop.py index 02d45a6..b46dbd8 100755 --- a/iotop.py +++ b/iotop.py @@ -301,9 +301,9 @@ class pinfo(object): # A process may exec, so we must always reread its cmdline try: proc_cmdline = open('/proc/%d/cmdline' % self.pid) + cmdline = proc_cmdline.read(4096) except IOError: return '{no such process}' - cmdline = proc_cmdline.read(4096) parts = cmdline.split('\0') if parts[0].startswith('/'): first_command_char = parts[0].rfind('/') + 1 -- 2.11.4.GIT