except ValueError:
continue
- for fd in os.listdir("/proc/%d/fd" % pid):
+ try:
+ fds = os.listdir("/proc/%d/fd" % pid)
+ except OSError:
+ continue
+
+ for fd in fds:
try:
fd = int(fd)
except ValueError:
print """
The following processes are listening for packets to arrive on network devices
that no longer exist. You may want to restart them."""
+ sys.stdout.flush()
os.execvp("ps", ["ps"] + ["%s" % pid for pid in bad_pids])