From: Kamalesh Babulal Date: Thu, 29 Sep 2022 10:20:56 +0000 (+0530) Subject: tools/cgconfig: use exit code 129 on invalid usage X-Git-Tag: v3.1.0~293 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=946f92b6042faa539d2a146eb4c42aa61e061b1f;p=thirdparty%2Flibcgroup.git tools/cgconfig: use exit code 129 on invalid usage The exit code 1 refers to general error and using -1 wraps to 255, both codes do not signify bad arguments. Let's use exit code 129 (EXIT_BADARGS) for hinting to the users about invalid usage. Signed-off-by: Kamalesh Babulal Signed-off-by: Tom Hromatka --- diff --git a/src/tools/cgconfig.c b/src/tools/cgconfig.c index ef57e184..b541d4b1 100644 --- a/src/tools/cgconfig.c +++ b/src/tools/cgconfig.c @@ -80,7 +80,7 @@ int main(int argc, char *argv[]) cgroup_set_default_logger(-1); if (argc < 2) { usage(1, argv[0]); - return -1; + exit(EXIT_BADARGS); } ret = cgroup_init(); @@ -141,14 +141,14 @@ int main(int argc, char *argv[]) break; default: usage(1, argv[0]); - error = -1; + error = EXIT_BADARGS; goto err; } } if (argv[optind]) { usage(1, argv[0]); - error = -1; + error = EXIT_BADARGS; goto err; }