From a739584d6fd749082e0b5ea4cb60955bddafef8c Mon Sep 17 00:00:00 2001 From: Matthew Rosato Date: Wed, 15 Sep 2021 11:49:39 -0400 Subject: [PATCH] libutil: add util_exit_code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit zdev uses a particular set of exit codes -- In preparation for sharing some zdev udev code with other libraries, let's also create a libutil include to specify reusable exit codes. For now, let's just initialize it with the codes from zdev we care about. Reviewed-by: Jan Höppner Reviewed-by: Jason J. Herne Reviewed-by: Peter Oberparleiter Signed-off-by: Matthew Rosato Signed-off-by: Jan Höppner --- include/lib/util_exit_code.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 include/lib/util_exit_code.h diff --git a/include/lib/util_exit_code.h b/include/lib/util_exit_code.h new file mode 100644 index 00000000..8735586d --- /dev/null +++ b/include/lib/util_exit_code.h @@ -0,0 +1,21 @@ +/** + * @defgroup util_exit_code_h util_exit_code: General purpose exit codes + * @{ + * @brief General purpose exit codes + * + * Copyright IBM Corp. 2022 + * + * s390-tools is free software; you can redistribute it and/or modify + * it under the terms of the MIT license. See LICENSE for details. + */ + +#ifndef LIB_UTIL_EXIT_CODE_H +#define LIB_UTIL_EXIT_CODE_H + +typedef enum { + UTIL_EXIT_OK = 0, /* Program finished successfully */ + UTIL_EXIT_RUNTIME_ERROR = 15, /* A run-time error occurred */ + UTIL_EXIT_OUT_OF_MEMORY = 22, /* Not enough available memory */ +} util_exit_code_t; + +#endif /** LIB_UTIL_EXIT_CODE_H @} */