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

Commit f3599b35 authored by Nick Kralevich's avatar Nick Kralevich
Browse files

dumpstate.cpp: collect command line earlier

We need to collect the command line before we use it.

Bug: 26777547
Change-Id: I715adce62511c4cc553eb462d853559687a1677f
parent 01add041
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -951,6 +951,13 @@ int main(int argc, char *argv[]) {
        }
    }

    /* read /proc/cmdline before dropping root */
    FILE *cmdline = fopen("/proc/cmdline", "re");
    if (cmdline) {
        fgets(cmdline_buf, sizeof(cmdline_buf), cmdline);
        fclose(cmdline);
    }

    print_header();

    /* open the vibrator before dropping root */
@@ -983,13 +990,6 @@ int main(int argc, char *argv[]) {
        }
    }

    /* read /proc/cmdline before dropping root */
    FILE *cmdline = fopen("/proc/cmdline", "re");
    if (cmdline) {
        fgets(cmdline_buf, sizeof(cmdline_buf), cmdline);
        fclose(cmdline);
    }

    /* collect stack traces from Dalvik and native processes (needs root) */
    dump_traces_path = dump_traces();