From: Tom Hromatka Date: Mon, 11 May 2020 02:23:06 +0000 (+0000) Subject: api.c: Declare cgroup_process_v1_mnt() as STATIC X-Git-Tag: v2.0.rc1~26 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=892572f6b3c66f436b252df1d4192847d87a386b;p=thirdparty%2Flibcgroup.git api.c: Declare cgroup_process_v1_mnt() as STATIC This commit changes cgroup_process_v1_mnt() from static to STATIC to allow it to be unit tested. Signed-off-by: Tom Hromatka Acked-by: Dhaval Giani --- diff --git a/src/api.c b/src/api.c index 1219cd03..887dc84b 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 dc292c66..5f45b237 100644 --- a/src/libcgroup-internal.h +++ b/src/libcgroup-internal.h @@ -22,6 +22,7 @@ __BEGIN_DECLS #include #include #include +#include #include #include #include @@ -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