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 2016/05/09 15:14:50 UTC

[07/13] incubator-mynewt-core git commit: bootutil; fix return status from boot_read_status().

bootutil; fix return status from boot_read_status().


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/f7eed4ed
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/f7eed4ed
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/f7eed4ed

Branch: refs/heads/develop
Commit: f7eed4ed295640fa75bb76851e9068d31c848555
Parents: d79c2ff
Author: Marko Kiiskila <ma...@runtime.io>
Authored: Wed May 4 10:40:57 2016 -0700
Committer: Marko Kiiskila <ma...@runtime.io>
Committed: Mon May 9 08:04:12 2016 -0700

----------------------------------------------------------------------
 libs/bootutil/src/bootutil_misc.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/f7eed4ed/libs/bootutil/src/bootutil_misc.c
----------------------------------------------------------------------
diff --git a/libs/bootutil/src/bootutil_misc.c b/libs/bootutil/src/bootutil_misc.c
index 94afb53..ced7aad 100644
--- a/libs/bootutil/src/bootutil_misc.c
+++ b/libs/bootutil/src/bootutil_misc.c
@@ -301,9 +301,10 @@ boot_read_status(struct boot_status *bs)
     rc = fsutil_read_file(BOOT_PATH_STATUS, 0, sizeof(*bs),
       bs, &bytes_read);
     if (rc || bytes_read != sizeof(*bs)) {
-        return BOOT_EBADSTATUS;
+        memset(bs, 0, sizeof(*bs));
+        return 0;
     }
-    return rc;
+    return 1;
 }
 
 int