am e7394ba8: am c02c35fb: Merge "restorecon /data/media when re-creating it for multi-user upgrade."
* commit 'e7394ba8bd9cd90a0fb72f6c50522a41cd7877fd':
restorecon /data/media when re-creating it for multi-user upgrade.
diff --git a/cmds/dumpstate/dumpstate.c b/cmds/dumpstate/dumpstate.c
index 3c79ae9..220af47 100644
--- a/cmds/dumpstate/dumpstate.c
+++ b/cmds/dumpstate/dumpstate.c
@@ -43,6 +43,8 @@
static char screenshot_path[PATH_MAX] = "";
+#define PSTORE_LAST_KMSG "/sys/fs/pstore/console-ramoops"
+
/* dumps the current system state to stdout */
static void dumpstate() {
time_t now = time(NULL);
@@ -161,8 +163,14 @@
dump_file("NETWORK ROUTES", "/proc/net/route");
dump_file("NETWORK ROUTES IPV6", "/proc/net/ipv6_route");
- /* TODO: Make last_kmsg CAP_SYSLOG protected. b/5555691 */
- dump_file("LAST KMSG", "/proc/last_kmsg");
+ if (!stat(PSTORE_LAST_KMSG, &st)) {
+ /* Also TODO: Make console-ramoops CAP_SYSLOG protected. */
+ dump_file("LAST KMSG", PSTORE_LAST_KMSG);
+ } else {
+ /* TODO: Make last_kmsg CAP_SYSLOG protected. b/5555691 */
+ dump_file("LAST KMSG", "/proc/last_kmsg");
+ }
+
dump_file("LAST PANIC CONSOLE", "/data/dontpanic/apanic_console");
dump_file("LAST PANIC THREADS", "/data/dontpanic/apanic_threads");
@@ -321,7 +329,7 @@
" -e: play sound file instead of vibrate, at end of job\n"
" -q: disable vibrate\n"
" -B: send broadcast when finished (requires -o and -p)\n"
- );
+ );
}
static void sigpipe_handler(int n) {