summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/bpf/cgroup_helpers.c
diff options
context:
space:
mode:
authorAndrey Ignatov <rdna@fb.com>2018-07-11 17:33:34 -0700
committerDaniel Borkmann <daniel@iogearbox.net>2018-07-15 00:08:41 +0200
commit04c13411151c220b41998020c32ac97f33b58683 (patch)
treeb50984df1762b9525021d876880a3971c93aa2e8 /tools/testing/selftests/bpf/cgroup_helpers.c
parent060a7fccd394f1600be86536b1d3e8cdd66637c2 (diff)
selftests/bpf: Fix const'ness in cgroup_helpers
Lack of const in cgroup helpers signatures forces to write ugly client code. Fix it. Signed-off-by: Andrey Ignatov <rdna@fb.com> Acked-by: Alexei Starovoitov <ast@kernel.org> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'tools/testing/selftests/bpf/cgroup_helpers.c')
-rw-r--r--tools/testing/selftests/bpf/cgroup_helpers.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/testing/selftests/bpf/cgroup_helpers.c b/tools/testing/selftests/bpf/cgroup_helpers.c
index c87b4e052ce9..cf16948aad4a 100644
--- a/tools/testing/selftests/bpf/cgroup_helpers.c
+++ b/tools/testing/selftests/bpf/cgroup_helpers.c
@@ -118,7 +118,7 @@ static int join_cgroup_from_top(char *cgroup_path)
*
* On success, it returns 0, otherwise on failure it returns 1.
*/
-int join_cgroup(char *path)
+int join_cgroup(const char *path)
{
char cgroup_path[PATH_MAX + 1];
@@ -158,7 +158,7 @@ void cleanup_cgroup_environment(void)
* On success, it returns the file descriptor. On failure it returns 0.
* If there is a failure, it prints the error to stderr.
*/
-int create_and_get_cgroup(char *path)
+int create_and_get_cgroup(const char *path)
{
char cgroup_path[PATH_MAX + 1];
int fd;
@@ -186,7 +186,7 @@ int create_and_get_cgroup(char *path)
* which is an invalid cgroup id.
* If there is a failure, it prints the error to stderr.
*/
-unsigned long long get_cgroup_id(char *path)
+unsigned long long get_cgroup_id(const char *path)
{
int dirfd, err, flags, mount_id, fhsize;
union {