ovs-check-dead-ifs: Tolerate processes that disappear during run.
authorBen Pfaff <blp@nicira.com>
Thu, 5 Jul 2012 19:57:16 +0000 (12:57 -0700)
committerBen Pfaff <blp@nicira.com>
Thu, 5 Jul 2012 20:01:51 +0000 (13:01 -0700)
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>
AUTHORS
utilities/ovs-check-dead-ifs.in

diff --git a/AUTHORS b/AUTHORS
index 47f6ea316ac8ae348a7654eb48a633fdaf22ae4c..bf8c149dc501b0cdadd19707ce2e75c47b2254b3 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -80,6 +80,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
index 53185d6600241902f9ca6fbb1d03ffc9388dbc4e..9b806ed312f3fd94e4d8bf0871a6eb498bbd2723 100755 (executable)
@@ -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: