diff mbox series

[OSSTEST,2/8] standalone: Use mkdir -p

Message ID 20201001162439.18160-2-iwj@xenproject.org (mailing list archive)
State New, archived
Headers show
Series [OSSTEST,1/8] Executive: Fix an undef warning message | expand

Commit Message

Ian Jackson Oct. 1, 2020, 4:24 p.m. UTC
These two mkdir calls could fail if
standalone-generate-dump-flight-runvars is run without a log
directory, because they were not concurrency-correct.

mkdir -p should fix that.

Signed-off-by: Ian Jackson <iwj@xenproject.org>
---
 standalone | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
diff mbox series

Patch

diff --git a/standalone b/standalone
index 9553d6c9..4d1f3513 100755
--- a/standalone
+++ b/standalone
@@ -181,12 +181,8 @@  check_repos() {
 }
 
 ensure_logs() {
-    if [ ! -d "logs" ] ; then
-	mkdir "logs"
-    fi
-    if [ ! -d "logs/$flight" ] ; then
-	mkdir "logs/$flight"
-    fi
+    mkdir -p "logs"
+    mkdir -p "logs/$flight"
 }
 
 with_logging() {