From 127da29e9ab20a3be8096cbd7f7ff225a2ddd7b7 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 24 Mar 2010 19:06:49 +0100 Subject: add const where applicable, drop const where unnecessary This patch adds the const qualifier to a number of function arguments (mostly string arguments) so that client libraries can pass their own const strings to the library without having to cast their const'ness away. This also drops a couple of consts where call-by-value is done anyway, and which hence has no effect and just misleads the users and adds unnecessary noise to the signal. After all this is C, not C++. Signed-off-by: Lennart Poettering Acked-by: Dhaval Giani Signed-off-by: Dhaval Giani --- src/tools/cgclassify.c | 2 +- src/tools/cgexec.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/tools') diff --git a/src/tools/cgclassify.c b/src/tools/cgclassify.c index b2d6f18..f12fb22 100644 --- a/src/tools/cgclassify.c +++ b/src/tools/cgclassify.c @@ -44,7 +44,7 @@ int change_group_path(pid_t pid, struct cgroup_group_spec *cgroup_list[]) break; ret = cgroup_change_cgroup_path(cgroup_list[i]->path, pid, - cgroup_list[i]->controllers); + (const char*const*) cgroup_list[i]->controllers); if (ret) fprintf(stderr, "Error changing group of pid %d: %s\n", pid, cgroup_strerror(ret)); diff --git a/src/tools/cgexec.c b/src/tools/cgexec.c index 2c92964..6fec85a 100644 --- a/src/tools/cgexec.c +++ b/src/tools/cgexec.c @@ -123,7 +123,7 @@ int main(int argc, char *argv[]) ret = cgroup_change_cgroup_path(cgroup_list[i]->path, pid, - cgroup_list[i]->controllers); + (const char*const*) cgroup_list[i]->controllers); if (ret) { fprintf(stderr, "cgroup change of group failed\n"); -- cgit