Commit a32f1af3 authored by Fabio Utzig's avatar Fabio Utzig Committed by Fabio Utzig
Browse files

Fix overwrite-only under Zephyr

As reported by issue #384, some #ifdefery was wrongly done, which broke
overwrite-only mode under Zephyr.

Signed-off-by: default avatarFabio Utzig <utzig@apache.org>
parent 4b259128
Loading
Loading
Loading
Loading
+2 −2
Changes for boot/bootutil/src/loader.c: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -1523,7 +1523,7 @@ boot_swap_if_needed(int *out_swap_type)

    /* If a partial swap was detected, complete it. */
    if (bs.idx != BOOT_STATUS_IDX_0 || bs.state != BOOT_STATUS_STATE_0) {
#if MCUBOOT_OVERWRITE_ONLY
#ifdef MCUBOOT_OVERWRITE_ONLY
        /* Should never arrive here, overwrite-only mode has no swap state. */
        assert(0);
#else
@@ -1547,7 +1547,7 @@ boot_swap_if_needed(int *out_swap_type)
        case BOOT_SWAP_TYPE_TEST:
        case BOOT_SWAP_TYPE_PERM:
        case BOOT_SWAP_TYPE_REVERT:
#if MCUBOOT_OVERWRITE_ONLY
#ifdef MCUBOOT_OVERWRITE_ONLY
            rc = boot_copy_image(&bs);
#else
            rc = boot_swap_image(&bs);