Make the error stings const, just to be safe.
Signed-off-by: Jan Safranek <[email protected]>
---
include/libcgroup.h | 2 +-
src/api.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/include/libcgroup.h b/include/libcgroup.h
index 6a262e2..2cac820 100644
--- a/include/libcgroup.h
+++ b/include/libcgroup.h
@@ -288,7 +288,7 @@ int cgroup_get_current_controller_path(pid_t pid, const
char *controller,
* @code: error code for which the corresponding error string is to be
* returned
*/
-char *cgroup_strerror(int code);
+const char *cgroup_strerror(int code);
/**
* Return last errno, which caused ECGOTHER error.
diff --git a/src/api.c b/src/api.c
index cd2e298..169df2e 100644
--- a/src/api.c
+++ b/src/api.c
@@ -82,7 +82,7 @@ static pthread_rwlock_t rl_lock = PTHREAD_RWLOCK_INITIALIZER;
/* Namespace */
__thread char *cg_namespace_table[CG_CONTROLLER_MAX];
-char *cgroup_strerror_codes[] = {
+const char const *cgroup_strerror_codes[] = {
"Cgroup is not compiled in",
"Cgroup is not mounted",
"Cgroup does not exist",
@@ -2512,7 +2512,7 @@ cleanup_path:
return ret;
}
-char *cgroup_strerror(int code)
+const char *cgroup_strerror(int code)
{
if (code == ECGOTHER) {
return strerror_r(cgroup_get_last_errno(), errtext, MAXLEN);
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Libcg-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libcg-devel