]> git.ipfire.org Git - thirdparty/libcgroup.git/commitdiff
libcgroup: Return correct values in parse.y
authorDhaval Giani <dhaval@gondor.retis>
Tue, 1 Jun 2010 15:36:38 +0000 (17:36 +0200)
committerDhaval Giani <dhaval@gondor.retis>
Tue, 1 Jun 2010 15:36:38 +0000 (17:36 +0200)
Instead of returning a valid error on failure in parse.y, we
were returning 0. Fix that up.

Signed-off-by: Dhaval Giani <dhaval.giani@gmail.com>
src/parse.y

index a8cc864e47a14d9b01f092996f1534a347a67449..d40974254c93d7cde73e30fc8e38f74a84d1fb33 100644 (file)
@@ -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 '{' namespace_conf '}'
                if (!$$) {
                        fprintf(stderr, "parsing failed at line number %d\n",
                                line_no);
-                       $$ = 0;
+                       $$ = ECGCONFIGPARSEFAIL;
                        return $$;
                }
        }