Change the return value to more informative one
 the previous error message:
# /sbin/cgconfigparser -l /tmp/cgconfig.conf
can't create group "CBSFxx/Zcz6": Loading configuration file /etc/cgconfig.conf 
failed
Cgroup values are not equal

 the new error message
#/sbin/cgconfigparser -l /etc/cgconfig.conf
can't create group "CBSFxx/Zcz6": Loading configuration file /etc/cgconfig.conf 
failed
Value setting does not succeed




Signed-off-by: Ivana Hutarova Varekova <[email protected]>
---

 include/libcgroup/error.h |    1 +
 src/api.c                 |    7 ++++---
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/include/libcgroup/error.h b/include/libcgroup/error.h
index 908845e..5d20537 100644
--- a/include/libcgroup/error.h
+++ b/include/libcgroup/error.h
@@ -72,6 +72,7 @@ enum {
        ECGNAMESPACECONTROLLER,
        ECGMOUNTNAMESPACE,
        ECGROUPUNSUPP,
+       ECGCANTSETVALUE,
 };
 
 /**
diff --git a/src/api.c b/src/api.c
index 195e0e6..d6c8604 100644
--- a/src/api.c
+++ b/src/api.c
@@ -117,6 +117,7 @@ const char const *cgroup_strerror_codes[] = {
        "Controller in namespace does not exist",
        "Cannot have mount and namespace keyword in the same configuration 
file",
        "This kernel does not support this feature",
+       "Value setting does not succeed",
 };
 
 static int cg_chown_file(FTS *fts, FTSENT *ent, uid_t owner, gid_t group)
@@ -1311,7 +1312,7 @@ err:
  *
  * returns 0 on success. We recommend calling cg_delete_cgroup
  * if this routine fails. That should do the cleanup operation.
- * If ECGROUPNOTEQUAL is returned, the group was created successfully
+ * If ECGCANTSETVALUE is returned, the group was created successfully
  * but not all controller parameters were successfully set.
  */
 int cgroup_create_cgroup(struct cgroup *cgroup, int ignore_ownership)
@@ -1401,7 +1402,7 @@ int cgroup_create_cgroup(struct cgroup *cgroup, int 
ignore_ownership)
                                cgroup_dbg("failed to set %s: %s (%d)\n",
                                        path,
                                        cgroup_strerror(error), error);
-                               retval = ECGROUPNOTEQUAL;
+                               retval = ECGCANTSETVALUE;
                                continue;
                        }
                }
@@ -1556,7 +1557,7 @@ free_parent:
  * @cgroup: cgroup data structure to be filled with parent values and then
  *       passed down for creation
  * @ignore_ownership: Ignore doing a chown on the newly created cgroup
- * @return 0 on success, > 0 on failure.  If ECGROUPNOTEQUAL is returned,
+ * @return 0 on success, > 0 on failure.  If  ECGCANTSETVALUE is returned,
  * the group was created successfully, but not all controller parameters
  * were copied from the parent successfully; unfortunately, this is expected...
  */


------------------------------------------------------------------------------
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
Libcg-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libcg-devel

Reply via email to