You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by ma...@apache.org on 2017/03/07 00:05:41 UTC

[46/50] incubator-mynewt-core git commit: don't crash when dumping logs from shell. Dump full logs.

don't crash when dumping logs from shell.   Dump full logs.


Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/commit/e85707da
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/e85707da
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/e85707da

Branch: refs/heads/1_0_0_dev
Commit: e85707dad58de5b3ca8789961775a8daa938627f
Parents: 933f658
Author: Sterling Hughes <st...@runtime.io>
Authored: Sat Mar 4 10:09:18 2017 -0800
Committer: Marko Kiiskila <ma...@runtime.io>
Committed: Mon Mar 6 15:54:05 2017 -0800

----------------------------------------------------------------------
 sys/log/full/src/log_shell.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/e85707da/sys/log/full/src/log_shell.c
----------------------------------------------------------------------
diff --git a/sys/log/full/src/log_shell.c b/sys/log/full/src/log_shell.c
index e0f6d71..ae1fd3d 100644
--- a/sys/log/full/src/log_shell.c
+++ b/sys/log/full/src/log_shell.c
@@ -71,6 +71,7 @@ int
 shell_log_dump_all_cmd(int argc, char **argv)
 {
     struct log *log;
+    struct log_offset log_offset;
     int rc;
 
     log = NULL;
@@ -86,7 +87,12 @@ shell_log_dump_all_cmd(int argc, char **argv)
 
         console_printf("Dumping log %s\n", log->l_name);
 
-        rc = log_walk(log, shell_log_dump_entry, NULL);
+        log_offset.lo_arg = NULL;
+        log_offset.lo_ts = 0;
+        log_offset.lo_index = 0;
+        log_offset.lo_data_len = 0;
+
+        rc = log_walk(log, shell_log_dump_entry, &log_offset);
         if (rc != 0) {
             goto err;
         }