Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 121a206d authored by Sudheer Shanka's avatar Sudheer Shanka Committed by Android (Google) Code Review
Browse files

Merge "Ignore EEXIST errors when creating pkg specific dirs."

parents a835f263 0ad0d897
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -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)));
    }