This commit changes cgroup_process_v1_mnt() from static to STATIC to allow it to be unit tested.
Signed-off-by: Tom Hromatka <tom.hroma...@oracle.com> --- src/api.c | 2 +- src/libcgroup-internal.h | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/api.c b/src/api.c index bb3a86ef8305..ece498c3d197 100644 --- a/src/api.c +++ b/src/api.c @@ -1047,7 +1047,7 @@ int cg_add_duplicate_mount(struct cg_mount_table_s *item, const char *path) * @param ent File system description of cgroup mount being processed * @param mnt_tbl_idx cg_mount_table index */ -static int cgroup_process_v1_mnt(char *controllers[], struct mntent *ent, +STATIC int cgroup_process_v1_mnt(char *controllers[], struct mntent *ent, int *mnt_tbl_idx) { char *strtok_buffer = NULL, *mntopt = NULL; diff --git a/src/libcgroup-internal.h b/src/libcgroup-internal.h index dc292c661842..5f45b2376877 100644 --- a/src/libcgroup-internal.h +++ b/src/libcgroup-internal.h @@ -22,6 +22,7 @@ __BEGIN_DECLS #include <fts.h> #include <libcgroup.h> #include <limits.h> +#include <mntent.h> #include <pthread.h> #include <sys/stat.h> #include <sys/types.h> @@ -318,6 +319,9 @@ bool cgroup_compare_ignore_rule(const struct cgroup_rule * const rule, bool cgroup_compare_wildcard_procname(const char * const rule_procname, const char * const procname); +int cgroup_process_v1_mnt(char *controllers[], struct mntent *ent, + int *mnt_tbl_idx); + #endif /* UNIT_TEST */ __END_DECLS -- 2.25.3 _______________________________________________ Libcg-devel mailing list Libcg-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/libcg-devel