vrahane commented on code in PR #3168:
URL: https://github.com/apache/mynewt-core/pull/3168#discussion_r1669256798


##########
sys/log/full/src/log.c:
##########
@@ -413,13 +538,21 @@ log_register(const char *name, struct log *log, const 
struct log_handler *lh,
         }
     }
 
-    /* If this is a persisted log, read the index from its most recent entry.
-     * We need to ensure the index of all subseqently written entries is
-     * monotonically increasing.
-     */
     if (log->l_log->log_type == LOG_TYPE_STORAGE) {
         rc = log_read_last_hdr(log, &hdr);
         if (rc == 0) {
+            /* If the number of entries are not set in the last header,
+             * it was probably not supported when the entry was logged.
+             * Count number of entries in this specific case
+             */
+            hdr.ue_num_entries = 0;

Review Comment:
   Yeah, it should not be set to 0 this way. I probably messed it up while 
squashing changes.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to