diff --git a/src/main.c b/src/main.c index 5c5cebd..1e98006 100644 --- a/src/main.c +++ b/src/main.c @@ -690,6 +690,10 @@ int main(int argc, char **argv) ret = dfuload_do_upload(dfu_root, transfer_size, expected_size, fd); } close(fd); + if (ret < 0) + ret = EX_IOERR; + else + ret = EX_OK; break; case MODE_DOWNLOAD: @@ -708,6 +712,10 @@ int main(int argc, char **argv) } else { ret = dfuload_do_dnload(dfu_root, transfer_size, &file); } + if (ret < 0) + ret = EX_IOERR; + else + ret = EX_OK; break; case MODE_DETACH: ret = dfu_detach(dfu_root->dev_handle, dfu_root->interface, 1000);