diff options
author | 2019-02-20 08:11:25 +0000 | |
---|---|---|
committer | 2019-02-20 08:11:25 +0000 | |
commit | 121a206dad3d6cf65c6842f8f2cae12005621005 (patch) | |
tree | efcb4bcc9190406b034b7a9dc4a2a1307548fd95 | |
parent | a835f263156f4028ae39fdb76a67170b1a69cb47 (diff) | |
parent | 0ad0d897239cb4c49ffc86ab9903b0c989a1d594 (diff) |
Merge "Ignore EEXIST errors when creating pkg specific dirs."
-rw-r--r-- | core/jni/com_android_internal_os_Zygote.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/core/jni/com_android_internal_os_Zygote.cpp b/core/jni/com_android_internal_os_Zygote.cpp index 4649b5262723..15ceca96313e 100644 --- a/core/jni/com_android_internal_os_Zygote.cpp +++ b/core/jni/com_android_internal_os_Zygote.cpp @@ -666,7 +666,7 @@ static void CreateSubDirs(int dirfd, const std::string& parentDirPath, fail_fn(CREATE_ERROR("Failed to fstatat on %s/%s: %s", parentDirPath.c_str(), dirName.c_str(), strerror(errno))); } - if (TEMP_FAILURE_RETRY(mkdirat(dirfd, dirName.c_str(), 0700)) == -1) { + if (TEMP_FAILURE_RETRY(mkdirat(dirfd, dirName.c_str(), 0700)) == -1 && errno != EEXIST) { fail_fn(CREATE_ERROR("Failed to mkdirat on %s/%s: %s", parentDirPath.c_str(), dirName.c_str(), strerror(errno))); } @@ -686,7 +686,8 @@ static void EnsurePkgSpecificDirs(const std::string& path, fail_fn(CREATE_ERROR("Failed to unlink %s: %s", androidDir.c_str(), strerror(errno))); } - if (TEMP_FAILURE_RETRY(mkdir(androidDir.c_str(), 0700)) == -1) { + if (TEMP_FAILURE_RETRY(mkdir(androidDir.c_str(), 0700)) == -1 + && errno != EEXIST) { fail_fn(CREATE_ERROR("Failed to mkdir %s: %s", androidDir.c_str(), strerror(errno))); } @@ -732,7 +733,7 @@ static void CreatePkgSandboxSource(const std::string& sandboxSource, fail_fn_t f fail_fn(CREATE_ERROR("Failed to stat %s: %s", sandboxSource.c_str(), strerror(errno))); } - if (TEMP_FAILURE_RETRY(mkdir(sandboxSource.c_str(), 0700)) == -1) { + if (TEMP_FAILURE_RETRY(mkdir(sandboxSource.c_str(), 0700)) == -1 && errno != EEXIST) { fail_fn(CREATE_ERROR("Failed to mkdir %s: %s", sandboxSource.c_str(), strerror(errno))); } |