Hi Dhaval,

Ken'ichi Ohmichi wrote:
> I feel it is better that ECGROUPPARSEFAIL is renamed to ECGRULESPARSEFAIL
> and ECGCONFIGPARSEFAIL is added instead of EINVALCONFIG for the above
> error.
> 
> Current error list is defined as the following:
> 
> enum cgroup_errors {
>   [snip]
>   ECGROUPPARSEFAIL, /* Failed to parse rules configuration file. */
>   [snip]
> };
> 
> I think the error in /etc/cgconfig.conf should be distinguished from
> the one in /etc/cgrules.conf and these errors should be different values.
> For the readability, I will change the error list like the following:
> 
> enum cgroup_errors {
>   [snip]
> 
>   ECGRULESPARSEFAIL,  /* Failed to parse rules file (/etc/cgrules.conf). */
>   ECGCONFIGPARSEFAIL, /* Failed to parse config file (/etc/cgconfig.conf). */
> 
>   [snip]
> };
> 
> How about this ?
> If OK, I will create a new patch according to the above.

I tried to create new patches according to the above.
Could you please review them again ?


Thanks in advance
Ken'ichi Ohmichi

---
[PATCH-v2 1/2] Cleanup: Rename ECGROUPPARSEFAIL to ECGRULESPARSEFAIL.

Changelog since v1:
o A new patch [Cleanup: Rename ECGROUPPARSEFAIL to ECGRULESPARSEFAIL.]


Now ECGROUPPARSEFAIL is defined for a parser error of /etc/cgrules.conf and
this patch renames ECGROUPPARSEFAIL to ECGRULESPARSEFAIL for clarifying its
meaning.


Signed-off-by: Ken'ichi Ohmichi <[email protected]>

diff --git a/include/libcgroup.h b/include/libcgroup.h
index f424562..8cb082d 100644
--- a/include/libcgroup.h
+++ b/include/libcgroup.h
@@ -83,7 +83,7 @@ enum cgroup_errors {
        ECGOTHER,       /* OS error, see errno */
        ECGROUPNOTEQUAL,
        ECGCONTROLLERNOTEQUAL,
-       ECGROUPPARSEFAIL, /* Failed to parse rules configuration file. */
+       ECGRULESPARSEFAIL, /* Failed to parse rules file (cgrules.conf). */
        ECGROUPNORULES, /* Rules list does not exist. */
        ECGMOUNTFAIL,
        ECGSENTINEL,    /* Please insert further error codes above this */
diff --git a/src/api.c b/src/api.c
index a0e1b9b..28c0c3d 100644
--- a/src/api.c
+++ b/src/api.c
@@ -591,7 +591,7 @@ destroyrule:
        cgroup_free_rule(newrule);
 
 parsefail:
-       ret = ECGROUPPARSEFAIL;
+       ret = ECGRULESPARSEFAIL;
 
 close:
        fclose(fp);
@@ -2366,7 +2366,7 @@ int cgroup_reload_cached_rules()
        if (ret) {
                cgroup_dbg("Error parsing configuration file \"%s\": %d.\n",
                        CGRULES_CONF_FILE, ret);
-               ret = ECGROUPPARSEFAIL;
+               ret = ECGRULESPARSEFAIL;
                goto finished;
        }
                
diff --git a/src/config.c b/src/config.c
index da2c268..b0016aa 100644
--- a/src/config.c
+++ b/src/config.c
@@ -467,7 +467,7 @@ int cgroup_config_load_config(const char *pathname)
        if (yyparse() != 0) {
                cgroup_dbg("Failed to parse file %s\n", pathname);
                fclose(yyin);
-               return ECGROUPPARSEFAIL;
+               return ECGRULESPARSEFAIL;
        }
 
        error = cgroup_config_mount_fs();

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Libcg-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libcg-devel

Reply via email to