Merge pull request #1595 from rubenk/turbostat-fix-shadowing-issue
authorRuben Kerkhof <ruben@tilaa.nl>
Fri, 4 Mar 2016 11:15:31 +0000 (12:15 +0100)
committerRuben Kerkhof <ruben@tilaa.nl>
Fri, 4 Mar 2016 11:15:31 +0000 (12:15 +0100)
Turbostat: fix shadowing issue

src/ceph.c
src/daemon/utils_avltree.c

index 251def9..9c53a3e 100644 (file)
@@ -1097,7 +1097,7 @@ static int cconn_connect(struct cconn *io)
     fd = socket(PF_UNIX, SOCK_STREAM, 0);
     if(fd < 0)
     {
-        int err = -errno;
+        err = -errno;
         ERROR("ceph plugin: cconn_connect: socket(PF_UNIX, SOCK_STREAM, 0) "
             "failed: error %d", err);
         return err;
@@ -1546,7 +1546,7 @@ static int cconn_main_loop(uint32_t request_type)
             }
             else
             {
-                int ret = cconn_handle_event(io);
+                ret = cconn_handle_event(io);
                 if(ret)
                 {
                     WARNING("ceph plugin: cconn_handle_event(name=%s,"
index 58b8b84..fcfbb94 100644 (file)
@@ -245,7 +245,7 @@ static void rebalance (c_avl_tree_t *t, c_avl_node_t *n)
                {
                        assert (n->right != NULL);
                        b_bottom = BALANCE (n->right);
-                       assert ((b_bottom >= -1) || (b_bottom <= 1));
+                       assert ((b_bottom >= -1) && (b_bottom <= 1));
                        if (b_bottom == 1)
                                n = rotate_right_left (t, n);
                        else
@@ -255,7 +255,7 @@ static void rebalance (c_avl_tree_t *t, c_avl_node_t *n)
                {
                        assert (n->left != NULL);
                        b_bottom = BALANCE (n->left);
-                       assert ((b_bottom >= -1) || (b_bottom <= 1));
+                       assert ((b_bottom >= -1) && (b_bottom <= 1));
                        if (b_bottom == -1)
                                n = rotate_left_right (t, n);
                        else