Skip to content

Commit

Permalink
Merge pull request #40 from ejoerns/v0/topic/mark-good-priority
Browse files Browse the repository at this point in the history
bootstate.c: do not set priority for marking slot good
  • Loading branch information
jluebbe committed Apr 26, 2016
2 parents dea6095 + bba97fc commit bd06357
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/bootchooser.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,20 +104,19 @@ static gboolean barebox_state_set(GPtrArray *pairs) {
static gboolean barebox_set_state(RaucSlot *slot, gboolean good) {
gboolean res = FALSE;
GPtrArray *pairs = g_ptr_array_new_full(10, g_free);
int prio, attempts;
int attempts;

g_assert_nonnull(slot);

if (good) {
prio = 20;
attempts = 3;
} else {
prio = 0;
/* for marking bad, also set priority to 0 */
attempts = 0;
g_ptr_array_add(pairs, g_strdup_printf("%s.%s.priority=%i",
BOOTSTATE_PREFIX, slot->bootname, 0));
}

g_ptr_array_add(pairs, g_strdup_printf("%s.%s.priority=%i",
BOOTSTATE_PREFIX, slot->bootname, prio));
g_ptr_array_add(pairs, g_strdup_printf("%s.%s.remaining_attempts=%i",
BOOTSTATE_PREFIX, slot->bootname, attempts));

Expand Down

0 comments on commit bd06357

Please sign in to comment.