Message ID | 20180607065438.18257-1-mikey@neuling.org |
---|---|
State | Accepted |
Headers | show |
Series | [01/11] Cleanup exit code | expand |
Thanks Mikey, series applied. - Alistair On Thursday, 7 June 2018 4:54:28 PM AEST Michael Neuling wrote: > Signed-off-by: Michael Neuling <mikey@neuling.org> > --- > src/main.c | 17 ++++++----------- > 1 file changed, 6 insertions(+), 11 deletions(-) > > diff --git a/src/main.c b/src/main.c > index 85770ef78c..26e141076e 100644 > --- a/src/main.c > +++ b/src/main.c > @@ -622,16 +622,11 @@ int main(int argc, char *argv[]) > return 1; > > found_action: > - 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", > - basename(argv[0])); > - rc = 1; > - } else > - rc = 0; > + if (rc > 0) > + return 0; > > - //if (backend == FSI) > - //fsi_destroy(NULL); > - > - return rc; > + 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", > + basename(argv[0])); > + return 1; > } >
diff --git a/src/main.c b/src/main.c index 85770ef78c..26e141076e 100644 --- a/src/main.c +++ b/src/main.c @@ -622,16 +622,11 @@ int main(int argc, char *argv[]) return 1; found_action: - 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", - basename(argv[0])); - rc = 1; - } else - rc = 0; + if (rc > 0) + return 0; - //if (backend == FSI) - //fsi_destroy(NULL); - - return rc; + 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", + basename(argv[0])); + return 1; }
Signed-off-by: Michael Neuling <mikey@neuling.org> --- src/main.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-)