From mboxrd@z Thu Jan 1 00:00:00 1970 From: Masahiro Yamada Date: Mon, 25 Aug 2014 12:39:45 +0900 Subject: [U-Boot] [PATCH v3 4/7] tools/genboardscfg.py: wait for unfinished subprocesses before error-out In-Reply-To: <1408937988-19923-1-git-send-email-yamada.m@jp.panasonic.com> References: <1408937988-19923-1-git-send-email-yamada.m@jp.panasonic.com> Message-ID: <1408937988-19923-5-git-send-email-yamada.m@jp.panasonic.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 --- Changes in v3: None Changes in v2: None tools/genboardscfg.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/genboardscfg.py b/tools/genboardscfg.py index 722b316..67d450f 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): -- 1.9.1