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

Commit 15fd60e8 authored by Felipe Leme's avatar Felipe Leme Committed by android-build-merger
Browse files

Merge "Rename .zip file if necessary." into nyc-dev am: ed9e142f

am: fa28614b

* commit 'fa28614b':
  Rename .zip file if necessary.
parents 8205d7fa fa28614b
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -1327,6 +1327,17 @@ int main(int argc, char *argv[]) {
                do_text_file = true;
            } else {
                do_text_file = false;
                // Since zip file is already created, it needs to be renamed.
                std::string new_path = bugreport_dir + "/" + base_name + "-" + suffix + ".zip";
                if (path != new_path) {
                    MYLOGD("Renaming zip file from %s to %s\n", path.c_str(), new_path.c_str());
                    if (rename(path.c_str(), new_path.c_str())) {
                        MYLOGE("rename(%s, %s): %s\n", path.c_str(),
                                new_path.c_str(), strerror(errno));
                    } else {
                        path = new_path;
                    }
                }
            }
        }
        if (do_text_file) {