You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by GitBox <gi...@apache.org> on 2018/05/14 11:40:18 UTC

[GitHub] mkiiskila commented on a change in pull request #1029: sys/log: Improve log handler for slot1

mkiiskila commented on a change in pull request #1029: sys/log: Improve log handler for slot1
URL: https://github.com/apache/mynewt-core/pull/1029#discussion_r187914950
 
 

 ##########
 File path: mgmt/imgmgr/src/imgmgr.c
 ##########
 @@ -340,6 +356,45 @@ imgr_erase(struct mgmt_cbuf *cb)
     return 0;
 }
 
+static int
+imgr_erase_state(struct mgmt_cbuf *cb)
+{
+    const struct flash_area *fa;
+    int area_id;
+    int rc;
+    CborError g_err = CborNoError;
+
+    area_id = imgmgr_find_best_area_id();
+    if (area_id >= 0) {
+        rc = flash_area_open(area_id, &fa);
+        if (rc) {
+            return MGMT_ERR_EINVAL;
+        }
+
+        rc = flash_area_erase(fa, 0, sizeof(struct image_header));
 
 Review comment:
   Ignoring this rc? Looks like there's a similar issue in imgr_erase()...

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services