Skip to content

Commit

Permalink
app: fix exit messages
Browse files Browse the repository at this point in the history
[ upstream commit 487cfc2 ]

Some applications were printing useless messages with rte_exit()
after showing the help. Using exit() is enough in this case.

Some applications were using a redundant printf or fprintf() before
calling rte_exit(). The messages are unified in a single rte_exit().

Some rte_exit() calls were missing a line feed or returning a wrong code.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Wisam Jaddo <wisamm@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Acked-by: David Marchand <david.marchand@redhat.com>
  • Loading branch information
tmonjalo authored and cpaelzer committed May 12, 2021
1 parent b24becd commit b61be79
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/test-compress-perf/comp_perf_options_parse.c
Expand Up @@ -598,7 +598,7 @@ comp_perf_options_parse(struct comp_test_data *test_data, int argc, char **argv)
switch (opt) {
case 'h':
usage(argv[0]);
rte_exit(EXIT_SUCCESS, "Displayed help\n");
exit(EXIT_SUCCESS);
break;
/* long options */
case 0:
Expand Down
2 changes: 1 addition & 1 deletion app/test-crypto-perf/cperf_options_parsing.c
Expand Up @@ -953,7 +953,7 @@ cperf_options_parse(struct cperf_options *options, int argc, char **argv)
switch (opt) {
case 'h':
usage(argv[0]);
rte_exit(EXIT_SUCCESS, "Displayed help\n");
exit(EXIT_SUCCESS);
break;
/* long options */
case 0:
Expand Down
4 changes: 2 additions & 2 deletions app/test-pmd/parameters.c
Expand Up @@ -694,7 +694,7 @@ launch_args_parse(int argc, char** argv)
case 0: /*long options */
if (!strcmp(lgopts[opt_idx].name, "help")) {
usage(argv[0]);
rte_exit(EXIT_SUCCESS, "Displayed help\n");
exit(EXIT_SUCCESS);
}
#ifdef RTE_LIBRTE_CMDLINE
if (!strcmp(lgopts[opt_idx].name, "interactive")) {
Expand Down Expand Up @@ -1356,7 +1356,7 @@ launch_args_parse(int argc, char** argv)
break;
case 'h':
usage(argv[0]);
rte_exit(EXIT_SUCCESS, "Displayed help\n");
exit(EXIT_SUCCESS);
break;
default:
usage(argv[0]);
Expand Down

0 comments on commit b61be79

Please sign in to comment.