diff mbox

[U-Boot,4/7] tools/genboardscfg.py: wait for unfinished subprocesses before error-out

Message ID 1408535269-24066-5-git-send-email-yamada.m@jp.panasonic.com
State Superseded
Delegated to: Tom Rini
Headers show

Commit Message

Masahiro Yamada Aug. 20, 2014, 11:47 a.m. UTC
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=<work_dir> ...") 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 <yamada.m@jp.panasonic.com>
---

 tools/genboardscfg.py | 3 +++
 1 file changed, 3 insertions(+)

Comments

Simon Glass Aug. 20, 2014, 7:05 p.m. UTC | #1
On 20 August 2014 05:47, Masahiro Yamada <yamada.m@jp.panasonic.com> wrote:
> 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=<work_dir> ...") 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 <yamada.m@jp.panasonic.com>

Acked-by: Simon Glass <sjg@chromium.org>
diff mbox

Patch

diff --git a/tools/genboardscfg.py b/tools/genboardscfg.py
index bdedb00..9b3a9bf 100755
--- a/tools/genboardscfg.py
+++ b/tools/genboardscfg.py
@@ -280,6 +280,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):