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

Commit c34489c9 authored by Kean Mariotti's avatar Kean Mariotti
Browse files

Fix file permissions of generated layers trace

Fix: 305129514
Test: adb shell rm /data/misc/wmtrace/layers_trace_from_transactions.winscope \
    && adb bugreport \
    && check generated bugreport contains FS/data/misc/wmtrace/layers_trace_from_transactions.winscope
Change-Id: I7cf087265df9ce1cc5da8536d6b03285685cd26e
parent 3feea1b9
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -64,8 +64,17 @@ int main(int argc, char** argv) {

    if (!LayerTraceGenerator().generate(transactionTraceFile, traceFlags, layerTracing,
                                        generateLastEntryOnly)) {
        std::cout << "Error: Failed to generate layers trace " << outputLayersTracePath;
        std::cout << "Error: Failed to generate layers trace " << outputLayersTracePath << "\n";
        return -1;
    }

    // Set output file permissions (-rw-r--r--)
    outStream.close();
    const mode_t mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH;
    if (chmod(outputLayersTracePath, mode) != 0) {
        std::cout << "Error: Failed to set permissions of " << outputLayersTracePath << "\n";
        return -1;
    }

    return 0;
}