From: Masahiro Yamada Date: Mon, 25 Aug 2014 03:39:45 +0000 (+0900) Subject: tools/genboardscfg.py: wait for unfinished subprocesses before error-out X-Git-Tag: v2025.01-rc5-pxa1908~14776 X-Git-Url: http://git.dujemihanovic.xyz/%22http:/www.sics.se/static/git-favicon.png?a=commitdiff_plain;h=d6538d22de83110369752682cc3e3d3860e09d91;p=u-boot.git tools/genboardscfg.py: wait for unfinished subprocesses before error-out When an error occurs or the program is terminated by the user on the way, the destructer __del__ of class Slot is invoked and the work directories are removed. We have to make sure there are no subprocesses (in this case, "make O= ...") using the work directories before removing them. Otherwise the subprocess spits a bunch of error messages possibly causing more problems. Perhaps some users may get upset to see too many error messages. Signed-off-by: Masahiro Yamada Acked-by: Simon Glass --- diff --git a/tools/genboardscfg.py b/tools/genboardscfg.py index 1406acd46f..a0df7058b1 100755 --- a/tools/genboardscfg.py +++ b/tools/genboardscfg.py @@ -276,6 +276,9 @@ class Slot: def __del__(self): """Delete the working directory""" + if not self.occupied: + while self.ps.poll() == None: + pass shutil.rmtree(self.build_dir) def add(self, defconfig):