]> git.ipfire.org Git - thirdparty/libcgroup.git/commitdiff
tools: introduce bad arguments exit code
authorKamalesh Babulal <kamalesh.babulal@oracle.com>
Thu, 29 Sep 2022 10:19:50 +0000 (15:49 +0530)
committerTom Hromatka <tom.hromatka@oracle.com>
Fri, 30 Sep 2022 14:34:55 +0000 (08:34 -0600)
Introduce EXIT_BADARGS (129) error code to return, when the user passes
an invalid list of arguments. Currently, we return exit 1 which refers
to a general error, or exit -1 which wraps to 255, both codes do not
signify bad arguments. Let's use EXIT_BADARGS (exit code 129), from
tools hinting to the users about invalid usage.

Suggested-by: Tom Hromatka <tom.hromatka@oracle.com>
Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
src/tools/tools-common.h

index 5f3d55f1207084b8fd16cfc9164dcb4b8c228cb0..04888434a2261b7ac641cc0aab3c9a9ebdcdc071 100644 (file)
@@ -28,6 +28,8 @@ extern "C" {
 #define err(x...)      fprintf(stderr, x)
 #define info(x...)     fprintf(stdout, x)
 
+#define EXIT_BADARGS   129
+
 /**
  * Auxiliary specifier of group, used to store parsed command line options.
  */