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/04/08 17:27:33 UTC

[2/3] incubator-mynewt-core git commit: FCB; separate return code from fcb_init() if sector magic does not match.

FCB; separate return code from fcb_init() if sector magic does not match.


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

Branch: refs/heads/develop
Commit: d3f4915119bdbdb415aab699642246fbce02ba58
Parents: 3748009
Author: Marko Kiiskila <ma...@runtime.io>
Authored: Fri Apr 8 08:24:02 2016 -0700
Committer: Marko Kiiskila <ma...@runtime.io>
Committed: Fri Apr 8 08:25:50 2016 -0700

----------------------------------------------------------------------
 sys/fcb/src/fcb.c | 3 +++
 1 file changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/d3f49151/sys/fcb/src/fcb.c
----------------------------------------------------------------------
diff --git a/sys/fcb/src/fcb.c b/sys/fcb/src/fcb.c
index 9c9eb44..60aac43 100644
--- a/sys/fcb/src/fcb.c
+++ b/sys/fcb/src/fcb.c
@@ -193,5 +193,8 @@ fcb_sector_hdr_read(struct fcb *fcb, struct flash_area *fap,
     if (fdap->fd_magic == 0xffffffff) {
         return 0;
     }
+    if (fdap->fd_magic != fcb->f_magic) {
+        return FCB_ERR_MAGIC;
+    }
     return 1;
 }