diff options
author | Ben Pfaff <blp@nicira.com> | 2012-07-05 12:57:16 -0700 |
---|---|---|
committer | Ben Pfaff <blp@nicira.com> | 2012-07-05 13:03:25 -0700 |
commit | f972f3b48770fcd2228372f243ed51647491001e (patch) | |
tree | 978e6479898a1191898738194403920ea1518b60 | |
parent | 33790719a8617b77848e9a222d9f154547f19931 (diff) | |
download | openvswitch-f972f3b48770fcd2228372f243ed51647491001e.tar.gz |
ovs-check-dead-ifs: Tolerate processes that disappear during run.
os.listdir("/proc/%d/fd" % pid) throws OSError if 'pid' died since the
list of pids was obtained.
Bug #12375.
Reported-by: Amey Bhide <abhide@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
-rw-r--r-- | AUTHORS | 1 | ||||
-rwxr-xr-x | utilities/ovs-check-dead-ifs.in | 7 |
2 files changed, 7 insertions, 1 deletions
@@ -77,6 +77,7 @@ Alan Shieh ashieh@nicira.com Alban Browaeys prahal@yahoo.com Alex Yip alex@nicira.com Alexey I. Froloff raorn@altlinux.org +Amey Bhide abhide@nicira.com André Ruß andre.russ@hybris.com Andreas Beckmann debian@abeckmann.de Atzm Watanabe atzm@stratosphere.co.jp diff --git a/utilities/ovs-check-dead-ifs.in b/utilities/ovs-check-dead-ifs.in index 53185d660..9b806ed31 100755 --- a/utilities/ovs-check-dead-ifs.in +++ b/utilities/ovs-check-dead-ifs.in @@ -62,7 +62,12 @@ for pid in os.listdir("/proc"): 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: |