]> git.ipfire.org Git - thirdparty/libcgroup.git/commitdiff
Change the return value to more informative one
authorIvana Hutarova Varekova <varekova@redhat.com>
Wed, 18 Aug 2010 09:22:54 +0000 (11:22 +0200)
committerJan Safranek <jsafrane@redhat.com>
Thu, 2 Sep 2010 10:36:28 +0000 (12:36 +0200)
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 <varekova@redhat.com>
Signed-off-by: Jan Safranek <jsafrane@redhat.com>
include/libcgroup/error.h
src/api.c

index 908845ee397d356c62029eb204a125c6efabf7ab..5d20537a61041f4d02006794895a1432bb7e4140 100644 (file)
@@ -72,6 +72,7 @@ enum {
        ECGNAMESPACECONTROLLER,
        ECGMOUNTNAMESPACE,
        ECGROUPUNSUPP,
+       ECGCANTSETVALUE,
 };
 
 /**
index 4bd6b463c56d3451a4d47c3a5911963d105c107c..492fb5150f4455e0f6b301b85c28514ec403c260 100644 (file)
--- 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...
  */