From: David Goulet Date: Sun, 17 Jul 2011 17:04:14 +0000 (-0400) Subject: Fix return code to 0 on success and 1 on error X-Git-Tag: v2.0-pre1~24 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=1fff1faa8195b6959cd53ca9cd7a51aa512db4ac;p=lttng-tools.git Fix return code to 0 on success and 1 on error Signed-off-by: David Goulet --- diff --git a/lttng/lttng.c b/lttng/lttng.c index 7c0abfaf2..77006bc7f 100644 --- a/lttng/lttng.c +++ b/lttng/lttng.c @@ -431,13 +431,13 @@ static int parse_args(int argc, char **argv) if (ret < 0) { if (ret == -1) { usage(stderr); - goto error; } else { ERR("%s", lttng_get_readable_code(ret)); } + goto error; } - return ret; + return 0; error: return -1; @@ -464,7 +464,9 @@ int main(int argc, char *argv[]) } ret = parse_args(argc, argv); - clean_exit(ret); + if (ret < 0) { + clean_exit(EXIT_FAILURE); + } return 0; }