From: Gurucharan Shetty Date: Fri, 11 May 2012 21:49:02 +0000 (-0700) Subject: ovs-bugtool: Close file descriptors after use. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a122b0fa65a62aa1db11c10efb1801ca9bba9cb4;p=openvswitch ovs-bugtool: Close file descriptors after use. In ovs-bugtool, we do a bunch of Popen calls to get the results of some shell commands with stdout set to PIPE. Once we are done, we need to close the file descriptors. Bug #11083. Signed-off-by: Gurucharan Shetty --- diff --git a/utilities/bugtool/ovs-bugtool.in b/utilities/bugtool/ovs-bugtool.in index 2df3e66b..3daf9cca 100755 --- a/utilities/bugtool/ovs-bugtool.in +++ b/utilities/bugtool/ovs-bugtool.in @@ -1175,6 +1175,7 @@ class ProcOutput: def terminate(self): if self.running: try: + self.proc.stdout.close() os.kill(self.proc.pid, SIGTERM) except: pass @@ -1187,6 +1188,7 @@ class ProcOutput: line = self.proc.stdout.readline() if line == '': # process exited + self.proc.stdout.close() self.status = self.proc.wait() self.proc = None self.running = False