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

Commit 31c84b18 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "fix getRss crash"

parents 5f48d6bf 8d652176
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1137,7 +1137,7 @@ static jlongArray android_os_Process_getRss(JNIEnv* env, jobject clazz, jint pid
    UniqueFile file = MakeUniqueFile(status_path.c_str(), "re");

    char line[256];
    while (fgets(line, sizeof(line), file.get())) {
    while (file != nullptr && fgets(line, sizeof(line), file.get())) {
        jlong v;
        if ( sscanf(line, "VmRSS: %" SCNd64 " kB", &v) == 1) {
            rss[0] = v;