diff options
author | David Gibson <david@gibson.dropbear.id.au> | 2024-06-05 10:42:40 +1000 |
---|---|---|
committer | Stefano Brivio <sbrivio@redhat.com> | 2024-06-05 21:14:03 +0200 |
commit | e651197b5c80c125326605b96357bac24c804487 (patch) | |
tree | 8aecca818aa1221b4ff15c893dd8303506a7920b | |
parent | e84a01e94c9f0ced5b1c0a6b87c053c01c686c86 (diff) | |
download | passt-e651197b5c80c125326605b96357bac24c804487.tar passt-e651197b5c80c125326605b96357bac24c804487.tar.gz passt-e651197b5c80c125326605b96357bac24c804487.tar.bz2 passt-e651197b5c80c125326605b96357bac24c804487.tar.lz passt-e651197b5c80c125326605b96357bac24c804487.tar.xz passt-e651197b5c80c125326605b96357bac24c804487.tar.zst passt-e651197b5c80c125326605b96357bac24c804487.zip |
conf: Remove unhelpful usage() wrapper
usage() does nothing but call print_usage() with EXIT_FAILURE as a
parameter. It's no more complex to just give that parameter at the single
call site. Eliminate it and rename print_usage() to just usage().
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
-rw-r--r-- | conf.c | 17 |
1 files changed, 4 insertions, 13 deletions
@@ -704,11 +704,11 @@ static unsigned int conf_ip6(unsigned int ifi, } /** - * print_usage() - Print usage, exit with given status code + * usage() - Print usage, exit with given status code * @name: Executable name * @status: Status code for exit() */ -static void print_usage(const char *name, int status) +static void usage(const char *name, int status) { if (strstr(name, "pasta")) { info("Usage: %s [OPTION]... [COMMAND] [ARGS]...", name); @@ -898,15 +898,6 @@ pasta_opts: } /** - * usage() - Print usage and exit with failure - * @name: Executable name - */ -static void usage(const char *name) -{ - print_usage(name, EXIT_FAILURE); -} - -/** * conf_print() - Print fundamental configuration parameters * @c: Execution context */ @@ -1647,11 +1638,11 @@ void conf(struct ctx *c, int argc, char **argv) break; case 'h': log_to_stdout = 1; - print_usage(argv[0], EXIT_SUCCESS); + usage(argv[0], EXIT_SUCCESS); break; case '?': default: - usage(argv[0]); + usage(argv[0], EXIT_FAILURE); break; } } while (name != -1); |