Ignore EEXIST errors when creating pkg specific dirs.
Some of the pkg specific dirs could be created by zygote
and vold in parallel, so ignore any EEXIST errors while
creating these dirs.
Bug: 118185801
Test: manual
Change-Id: Ifaa9998131764304867ac027af335414dbfc291c
diff --git a/Utils.cpp b/Utils.cpp
index aa2288b..0a16fc1 100644
--- a/Utils.cpp
+++ b/Utils.cpp
@@ -235,7 +235,7 @@
PLOG(ERROR) << "Failed to stat " << dir;
return -errno;
}
- if (TEMP_FAILURE_RETRY(mkdir(dir.c_str(), mode)) == -1) {
+ if (TEMP_FAILURE_RETRY(mkdir(dir.c_str(), mode)) == -1 && errno != EEXIST) {
PLOG(ERROR) << "Failed to mkdir " << dir;
return -errno;
}