[Sheepdog] [PATCH] add panic()

FUJITA Tomonori fujita.tomonori at lab.ntt.co.jp
Wed Apr 21 08:12:17 CEST 2010


We should kill the daemon in the case of a critical error to avoid the
worth events like data corruption.

Signed-off-by: FUJITA Tomonori <fujita.tomonori at lab.ntt.co.jp>
---
 collie/collie.h |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/collie/collie.h b/collie/collie.h
index 4cb8057..8e43492 100644
--- a/collie/collie.h
+++ b/collie/collie.h
@@ -138,4 +138,10 @@ static inline int is_myself(struct sheepdog_node_list_entry *e)
 	return e->id == sys->this_node.id;
 }
 
+#define panic(fmt, args...)			\
+({						\
+	vprintf(SDOG_EMERG fmt, ##args);	\
+	exit(1);				\
+})
+
 #endif
-- 
1.6.5




More information about the sheepdog mailing list