[Sheepdog] [PATCH] collie: exit when we cannot get node list

MORITA Kazutaka morita.kazutaka at lab.ntt.co.jp
Sat Oct 15 06:23:47 CEST 2011


Signed-off-by: MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp>
---
 collie/collie.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/collie/collie.c b/collie/collie.c
index 76dcaf2..c5cf58d 100644
--- a/collie/collie.c
+++ b/collie/collie.c
@@ -95,6 +95,10 @@ static int update_node_list(int max_nodes, int epoch)
 	}
 
 	nr_nodes = size / sizeof(*ent);
+	if (nr_nodes == 0) {
+		fprintf(stderr, "there is no active sheep daemons\n");
+		exit(EXIT_FAILURE);
+	}
 
 	/* FIXME */
 	if (nr_nodes > max_nodes) {
-- 
1.7.6.3




More information about the sheepdog mailing list