Commit ce8148aa authored by Martín Ferrari's avatar Martín Ferrari

Remove unneeded import; avoid duplicate checks in cleanup().

parent f23135ea
# vim:ts=4:sw=4:et:ai:sts=4
import errno, os, socket, sys, traceback, unshare, weakref
import os, socket, sys, traceback, unshare, weakref
from netns.environ import *
import netns.interface, netns.protocol, netns.subprocess_
......
......@@ -97,9 +97,9 @@ class Server(object):
# -PID to kill to whole process group
os.kill(-pid, signal.SIGTERM)
now = time.time()
ch = self._children
ch = set(self._children)
while time.time() - now < KILL_WAIT:
for pid in set(ch):
for pid in ch:
try:
if netns.subprocess_.poll(pid):
ch.remove(pid)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment