dumpstate: improved collection, better error handling.
- Some of the commands used by dumpstate, which drops root, will not collect
anything during a bug report. E.g. df fails on /mnt/secure/asec.
- force flushing of error message
. without the flush (using gingerbread and not master)
*** netcfg: Exit code 255
. with the flush()
*** exec(netcfg): Permission denied
*** netcfg: Exit code 255
- add a check before using WEXITSTATUS()
Change-Id: Ia3924b9cc8a12cecab894cbf7f2c79614a358d34
Signed-off-by: JP Abgrall <jpa@google.com>
diff --git a/cmds/dumpstate/dumpstate.c b/cmds/dumpstate/dumpstate.c
index b1b7715..f74e3c8 100644
--- a/cmds/dumpstate/dumpstate.c
+++ b/cmds/dumpstate/dumpstate.c
@@ -143,7 +143,7 @@
dump_file("BINDER STATS", "/sys/kernel/debug/binder/stats");
dump_file("BINDER STATE", "/sys/kernel/debug/binder/state");
- run_command("FILESYSTEMS & FREE SPACE", 10, "df", NULL);
+ run_command("FILESYSTEMS & FREE SPACE", 10, "su", "root", "df", NULL);
dump_file("PACKAGE SETTINGS", "/data/system/packages.xml");
dump_file("PACKAGE UID ERRORS", "/data/system/uiderrors.txt");