| 965 | } |
| 966 | |
| 967 | int clusterNodeAddSlave(clusterNode *master, clusterNode *slave) { |
| 968 | int j; |
| 969 | |
| 970 | /* If it's already a slave, don't add it again. */ |
| 971 | for (j = 0; j < master->numslaves; j++) |
| 972 | if (master->slaves[j] == slave) return C_ERR; |
| 973 | master->slaves = (clusterNode**)zrealloc(master->slaves, |
| 974 | sizeof(clusterNode*)*(master->numslaves+1), MALLOC_LOCAL); |
| 975 | master->slaves[master->numslaves] = slave; |
| 976 | master->numslaves++; |
| 977 | master->flags |= CLUSTER_NODE_MIGRATE_TO; |
| 978 | return C_OK; |
| 979 | } |
| 980 | |
| 981 | int clusterCountNonFailingSlaves(clusterNode *n) { |
| 982 | int j, okslaves = 0; |
no test coverage detected