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/10/03 12:39:11 UTC

[GitHub] sjanc closed pull request #11: image erase: allow only when slot image is not backup/pending...

sjanc closed pull request #11: image erase: allow only when slot image is not backup/pending...
URL: https://github.com/apache/mynewt-mcumgr/pull/11
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/cmd/img_mgmt/src/img_mgmt.c b/cmd/img_mgmt/src/img_mgmt.c
index fe91397..b00bc35 100644
--- a/cmd/img_mgmt/src/img_mgmt.c
+++ b/cmd/img_mgmt/src/img_mgmt.c
@@ -232,6 +232,11 @@ img_mgmt_erase(struct mgmt_ctxt *ctxt)
     CborError err;
     int rc;
 
+    if (img_mgmt_slot_in_use(1)) {
+        /* No free slot. */
+        return MGMT_ERR_EBADSTATE;
+    }
+    
     rc = img_mgmt_impl_erase_slot();
 
     err = 0;


 

----------------------------------------------------------------
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