]> git.ipfire.org Git - thirdparty/libcgroup.git/commitdiff
Make the error stings const
authorJan Safranek <jsafrane@redhat.com>
Mon, 8 Mar 2010 11:46:11 +0000 (12:46 +0100)
committerDhaval Giani <dhaval.giani@gmail.com>
Mon, 8 Mar 2010 14:02:36 +0000 (15:02 +0100)
Make the error stings const, just to be safe.

Signed-off-by: Jan Safranek <jsafrane@redhat.com>
Signed-off-by: Dhaval Giani <dhaval.giani@gmail.com>
include/libcgroup.h
src/api.c

index 6a262e215b2ba6cdf4171dfefde2200627ff63e7..2cac8207d44396edde590c56bf8868d67178a569 100644 (file)
@@ -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.
index cd2e298b93920685c017eec411fb6c079ad67bcd..169df2e6e4a49b58bf53b265208943ab8d7daf4e 100644 (file)
--- 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);