Declare parse_r_flag() as STATIC so that it can be
unit tested.
Signed-off-by: Tom Hromatka <[email protected]>
---
src/tools/cgset.c | 2 +-
src/tools/tools-common.h | 5 +++++
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/tools/cgset.c b/src/tools/cgset.c
index 4e8c1e7e1aa4..fca08d83f453 100644
--- a/src/tools/cgset.c
+++ b/src/tools/cgset.c
@@ -73,7 +73,7 @@ static void usage(int status, const char *program_name)
"parameters will be copied\n");
}
-static int parse_r_flag(const char * const program_name,
+STATIC int parse_r_flag(const char * const program_name,
const char * const name_value_str,
struct control_value * const name_value)
{
diff --git a/src/tools/tools-common.h b/src/tools/tools-common.h
index 7492bbbff78d..292c408e0d27 100644
--- a/src/tools/tools-common.h
+++ b/src/tools/tools-common.h
@@ -129,6 +129,11 @@ int parse_uid_gid(char *string, uid_t *uid, gid_t *gid,
* remaining static in a normal libcgroup build.
*/
#ifdef UNIT_TEST
+
+int parse_r_flag(const char * const program_name,
+ const char * const name_value_str,
+ struct control_value * const name_value);
+
#endif /* UNIT_TEST */
__END_DECLS
--
2.26.2
_______________________________________________
Libcg-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libcg-devel