Merge "Create stash dir recursively." am: 7a0b65472b am: 32932a48f9
am: 6f366ee4dd

Change-Id: I49e75d8ac06bf80447b205e9cd2e040c191ee106
diff --git a/updater/blockimg.cpp b/updater/blockimg.cpp
index 9d5b017..e35d483 100644
--- a/updater/blockimg.cpp
+++ b/updater/blockimg.cpp
@@ -53,6 +53,7 @@
 #include <ziparchive/zip_archive.h>
 
 #include "edify/expr.h"
+#include "otautil/dirutil.h"
 #include "otautil/error_code.h"
 #include "otautil/paths.h"
 #include "otautil/print_sha1.h"
@@ -878,7 +879,7 @@
   size_t max_stash_size = maxblocks * BLOCKSIZE;
   if (res == -1) {
     LOG(INFO) << "creating stash " << dirname;
-    res = mkdir(dirname.c_str(), STASH_DIRECTORY_MODE);
+    res = mkdir_recursively(dirname, STASH_DIRECTORY_MODE, false, nullptr);
 
     if (res != 0) {
       ErrorAbort(state, kStashCreationFailure, "mkdir \"%s\" failed: %s", dirname.c_str(),