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

Commit a926efce authored by Yifan Hong's avatar Yifan Hong Committed by Automerger Merge Worker
Browse files

init: don't abort if directory already exists am: 7e7f8815

Original change: https://android-review.googlesource.com/c/platform/system/core/+/1506376

Change-Id: I5a70265e408300a3343e95633f2e447d880f70b1
parents c3792a57 7e7f8815
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -117,7 +117,7 @@ void PrepareSwitchRoot() {

    auto dst_dir = android::base::Dirname(dst);
    std::error_code ec;
    if (!fs::create_directories(dst_dir, ec)) {
    if (!fs::create_directories(dst_dir, ec) && !!ec) {
        LOG(FATAL) << "Cannot create " << dst_dir << ": " << ec.message();
    }
    if (rename(src, dst) != 0) {
@@ -315,7 +315,7 @@ int FirstStageMain(int argc, char** argv) {
        std::string dest = GetRamdiskPropForSecondStage();
        std::string dir = android::base::Dirname(dest);
        std::error_code ec;
        if (!fs::create_directories(dir, ec)) {
        if (!fs::create_directories(dir, ec) && !!ec) {
            LOG(FATAL) << "Can't mkdir " << dir << ": " << ec.message();
        }
        if (!fs::copy_file(kBootImageRamdiskProp, dest, ec)) {