From 696b596ca966ead950cb8b5abd3d1a3fb8cc2048 Mon Sep 17 00:00:00 2001 From: Tormod Volden Date: Sat, 7 Nov 2020 21:32:05 +0100 Subject: [PATCH] dfuse: Return error code to main after unprotect or mass erase Signed-off-by: Tormod Volden --- src/dfuse.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/dfuse.c b/src/dfuse.c index 27271d8..198a3e0 100644 --- a/src/dfuse.c +++ b/src/dfuse.c @@ -690,9 +690,9 @@ int dfuse_do_dnload(struct dfu_if *dif, int xfer_size, struct dfu_file *file, "will erase the flash memory" "and can only be used with force\n"); } - dfuse_special_command(dif, 0, READ_UNPROTECT); + ret = dfuse_special_command(dif, 0, READ_UNPROTECT); printf("Device disconnects, erases flash and resets now\n"); - exit(EX_OK); + return ret; } if (dfuse_mass_erase) { if (!dfuse_force) { @@ -700,7 +700,7 @@ int dfuse_do_dnload(struct dfu_if *dif, int xfer_size, struct dfu_file *file, "can only be used with force"); } printf("Performing mass erase, this can take a moment\n"); - dfuse_special_command(dif, 0, MASS_ERASE); + ret = dfuse_special_command(dif, 0, MASS_ERASE); } if (!file->name) { printf("DfuSe command mode\n");