Instead of returning a valid error on failure in parse.y, we 
were returning 0. Fix that up.

Signed-off-by: Dhaval Giani <[email protected]>

Index: libcg/src/parse.y
===================================================================
--- libcg.orig/src/parse.y
+++ libcg/src/parse.y
@@ -249,7 +249,7 @@ mountvalue_conf
        {
                if (!cgroup_config_insert_into_mount_table($1, $3)) {
                        cgroup_config_cleanup_mount_table();
-                       $$ = 0;
+                       $$ = ECGCONFIGPARSEFAIL;
                        return $$;
                }
                $$ = 1;
@@ -258,7 +258,7 @@ mountvalue_conf
        {
                if (!cgroup_config_insert_into_mount_table($2, $4)) {
                        cgroup_config_cleanup_mount_table();
-                       $$ = 0;
+                       $$ = ECGCONFIGPARSEFAIL;
                        return $$;
                }
                $$ = 1;
@@ -282,7 +282,7 @@ namespace_conf
        {
                if (!cgroup_config_insert_into_namespace_table($1, $3)) {
                        cgroup_config_cleanup_namespace_table();
-                       $$ = 0;
+                       $$ = ECGCONFIGPARSEFAIL;
                        return $$;
                }
                $$ = 1;
@@ -291,7 +291,7 @@ namespace_conf
        {
                if (!cgroup_config_insert_into_namespace_table($2, $4)) {
                        cgroup_config_cleanup_namespace_table();
-                       $$ = 0;
+                       $$ = ECGCONFIGPARSEFAIL;
                        return $$;
                }
                $$ = 1;
@@ -304,7 +304,7 @@ namespace   :       NAMESPACE '{' namesp
                if (!$$) {
                        fprintf(stderr, "parsing failed at line number %d\n",
                                line_no);
-                       $$ = 0;
+                       $$ = ECGCONFIGPARSEFAIL;
                        return $$;
                }
        }



------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
Libcg-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libcg-devel

Reply via email to