aboutsummaryrefslogtreecommitdiff
path: root/whatmaps
diff options
context:
space:
mode:
Diffstat (limited to 'whatmaps')
-rwxr-xr-xwhatmaps9
1 files changed, 8 insertions, 1 deletions
diff --git a/whatmaps b/whatmaps
index a5c6a8b..8c4964b 100755
--- a/whatmaps
+++ b/whatmaps
@@ -23,6 +23,7 @@ import re
import string
import subprocess
import sys
+import errno
from optparse import OptionParser
try:
import apt_pkg
@@ -60,7 +61,13 @@ class Process(object):
def _read_maps(self):
"""Read the SOs from /proc/<pid>/maps"""
- for line in file('/proc/%d/maps' % self.pid):
+ try:
+ f = file('/proc/%d/maps' % self.pid)
+ except IOError as e:
+ # ignore killed process
+ if e.errno != errno.ENOENT:
+ raise
+ for line in f:
try:
so = line.split()[5].strip()
self.mapped.append(so)