summaryrefslogtreecommitdiff
path: root/commands
diff options
context:
space:
mode:
authorAhmad Fatoum <a.fatoum@pengutronix.de>2022-06-20 09:19:36 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2022-06-21 12:33:33 +0200
commitea162825a013c29823fed9e7d77c9671684cf247 (patch)
tree5c6959291f372a24d2214a5a1279d0937e79ad28 /commands
parent58c7c027acc4ebf27ddd622001bafb596e8123cf (diff)
downloadbarebox-ea162825a013c29823fed9e7d77c9671684cf247.tar.gz
state: don't report error for -ENOMEDIUM
Since commit 863a2251393e ("state: make first boot less verbose"), state_load returns -ENOMEDIUM instead of -ENOENT if we detect a first load because all buckets are zero. This case is expected and shouldn't warrant an error message, so adjust callers appropriately. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220620071936.1460295-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'commands')
-rw-r--r--commands/state.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/commands/state.c b/commands/state.c
index e7cb9902f7..56ef93b19f 100644
--- a/commands/state.c
+++ b/commands/state.c
@@ -53,6 +53,9 @@ static int do_state(int argc, char *argv[])
ret = state_save(state);
}
+ if (ret == -ENOMEDIUM)
+ ret = 0;
+
return ret;
}