]> git.ipfire.org Git - thirdparty/libcgroup.git/commitdiff
v2 [patch 2/6] wrapper.c: correct the return types
authorDhaval Giani <dhaval.giani@gmail.com>
Tue, 16 Nov 2010 13:29:47 +0000 (14:29 +0100)
committerDhaval Giani <dhaval.giani@gmail.com>
Tue, 16 Nov 2010 15:39:16 +0000 (16:39 +0100)
Steve Grubb was kind enough to do a review at
http://article.gmane.org/gmane.comp.lib.libcg.devel/2485
and pointed out that we were checking for unsigned values to be
negative. That is of course wrong, and we need to actually be
checking integers. Correct the return type so that the check
is valid once more.

Reported-by: Steve Grubb <sgrubb@redhat.com>
Signed-off-by: Dhaval Giani <dhaval.giani@gmail.com>
Acked-By: Jan Safranek <jsafrane@redhat.com>
src/wrapper.c

index 83c0030cbf3e23f2ce35afd4c64c5ce4c939dfb7..4828ea8bf39bea173e93c284887dbfb919fd96e6 100644 (file)
@@ -436,7 +436,7 @@ int cgroup_set_value_int64(struct cgroup_controller *controller,
                                        const char *name, int64_t value)
 {
        int i;
-       unsigned ret;
+       int ret;
 
        if (!controller)
                return ECGINVAL;
@@ -484,7 +484,7 @@ int cgroup_set_value_uint64(struct cgroup_controller *controller,
                                        const char *name, u_int64_t value)
 {
        int i;
-       unsigned ret;
+       int ret;
 
        if (!controller)
                return ECGINVAL;
@@ -538,7 +538,7 @@ int cgroup_set_value_bool(struct cgroup_controller *controller,
                                                const char *name, bool value)
 {
        int i;
-       unsigned ret;
+       int ret;
 
        if (!controller)
                return ECGINVAL;