diff options
author | Marc Kleine-Budde <mkl@pengutronix.de> | 2015-04-28 14:08:59 +0200 |
---|---|---|
committer | Marc Kleine-Budde <mkl@pengutronix.de> | 2015-04-28 15:13:37 +0200 |
commit | 95a37eb2ecc0a4642df39819e5eb085b1f525cee (patch) | |
tree | a82a4bdd6cb1f25e51a4ffb727cdd8a6cde3c9a5 /src | |
parent | 48888cffb9430ade0d5a5595b5df2986a7377241 (diff) | |
download | dt-utils-95a37eb2ecc0a4642df39819e5eb085b1f525cee.tar.gz dt-utils-95a37eb2ecc0a4642df39819e5eb085b1f525cee.tar.xz |
barebox-state: initialzie: adjust code to fit doc
This patch changes the -i, --init parameter to initialize the state storage and
_not_ load the contents. The original behaviour was to load and not fail on
error.
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Diffstat (limited to 'src')
-rw-r--r-- | src/barebox-state.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/barebox-state.c b/src/barebox-state.c index 6caa004..f7fa53a 100644 --- a/src/barebox-state.c +++ b/src/barebox-state.c @@ -1565,10 +1565,12 @@ int main(int argc, char *argv[]) if (IS_ERR(state)) exit(1); - ret = state_load(state); - if (!do_initialize && ret) { - fprintf(stderr, "Cannot load state: %s\n", strerror(-ret)); - exit(1); + if (!do_initialize) { + ret = state_load(state); + if (ret) { + fprintf(stderr, "Cannot load state: %s\n", strerror(-ret)); + exit(1); + } } if (do_dump) { |