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

Commit 00615f01 authored by Jeff Sharkey's avatar Jeff Sharkey Committed by Android (Google) Code Review
Browse files

Merge "Allow mkdir() race to succeed." into jb-mr1-dev

parents 9481266e 489609bb
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -55,9 +55,11 @@ int fs_prepare_dir(const char* path, mode_t mode, uid_t uid, gid_t gid) {

create:
    if (TEMP_FAILURE_RETRY(mkdir(path, mode)) == -1) {
        if (errno != EEXIST) {
            ALOGE("Failed to mkdir(%s): %s", path, strerror(errno));
            return -1;
        }
    }

fixup:
    if (TEMP_FAILURE_RETRY(chmod(path, mode)) == -1) {