Always return 1 from x52cli for any failure

Prior to this change, on failure condition, x52cli would exit with a
code that mapped directly to the return code of the function. This was
inconsistent with the behaviour if the initialization or connect steps
failed for any reason.
cpp
nirenjan 2022-06-12 03:32:25 -07:00
parent a119fe2c60
commit 44fba0c6cd
1 changed files with 1 additions and 0 deletions

View File

@ -541,6 +541,7 @@ int main(int argc, char **argv)
rc = (*(cmd->handler))(x52, args); rc = (*(cmd->handler))(x52, args);
if (rc != LIBX52_SUCCESS) { if (rc != LIBX52_SUCCESS) {
fprintf(stderr, "Error: %s\n", libx52_strerror(rc)); fprintf(stderr, "Error: %s\n", libx52_strerror(rc));
rc = 1;
} }
libx52_update(x52); libx52_update(x52);