summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlistair Popple <alistair@popple.id.au>2016-12-02 11:19:42 +1100
committerAlistair Popple <alistair@popple.id.au>2016-12-02 11:19:42 +1100
commitf0cdaefbb6c44d74465dfcbfa79292ed9765fccc (patch)
treebb53e1e05fd7adfaebe567d0424f400d210eaaae /src
parentcdfc8199b724bc2bb8dec3d2f5e63b35d7d68edf (diff)
downloadpdbg-f0cdaefbb6c44d74465dfcbfa79292ed9765fccc.tar.gz
pdbg-f0cdaefbb6c44d74465dfcbfa79292ed9765fccc.zip
src/main.c: Make return codes consistent
Always return -1 when encountering an error and 0 for success. Signed-off-by: Alistair Popple <alistair@popple.id.au>
Diffstat (limited to 'src')
-rw-r--r--src/main.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/main.c b/src/main.c
index 67ad3c7..72d59a4 100644
--- a/src/main.c
+++ b/src/main.c
@@ -893,10 +893,12 @@ int main(int argc, char *argv[])
break;
}
- if (!rc) {
+ if (rc <= 0) {
printf("No valid targets found or specified. Try adding -p/-c/-t options to specify a target.\n");
printf("Alternatively run %s -a probe to get a list of all valid targets\n", argv[0]);
- }
+ rc = -1;
+ } else
+ rc = 0;
/* TODO: We don't properly tear down all the targets yet */
targets[0].destroy(&targets[0]);
OpenPOWER on IntegriCloud