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

Commit faa49d1d authored by Yifan Hong's avatar Yifan Hong
Browse files

libsnapshot callstack files readable by dumpstate

Set callstack logs as 0644 so that they are readable
by dumpstate.

Test: take OTA, cancel, delete /data/misc/update_engine/prefs/*
manually, retrigger OTA (so that callstack is logged), then re-take bug report
Bug: 148818798

Change-Id: I598e484b57dcd3ce6ed7bb483aee57ce2ba881e7
parent bdf93248
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -232,7 +232,12 @@ bool SnapshotManager::RemoveAllUpdateState(LockedFile* lock) {
    LOG(WARNING) << callstack_str.c_str();
    std::stringstream path;
    path << "/data/misc/snapshotctl_log/libsnapshot." << Now() << ".log";
    android::base::WriteStringToFile(callstack_str.c_str(), path.str());
    std::string path_str = path.str();
    android::base::WriteStringToFile(callstack_str.c_str(), path_str);
    if (chmod(path_str.c_str(), 0644) == -1) {
        PLOG(WARNING) << "Unable to chmod 0644 "
                      << ", file maybe dropped from bugreport:" << path_str;
    }
#endif

    if (!RemoveAllSnapshots(lock)) {