[Sheepdog] [PATCH] move panic() to logger.h

MORITA Kazutaka morita.kazutaka at lab.ntt.co.jp
Thu Sep 29 20:49:42 CEST 2011


panic() should be available for all who can use logger.

Signed-off-by: MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp>
---
 include/logger.h   |    6 ++++++
 sheep/sheep_priv.h |    6 ------
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/include/logger.h b/include/logger.h
index 68899a5..9ce5d5e 100644
--- a/include/logger.h
+++ b/include/logger.h
@@ -66,6 +66,12 @@ do {									\
 	log_write(LOG_INFO, __func__, __LINE__, fmt, ##args);		\
 } while (0)
 
+#define panic(fmt, args...)			\
+({						\
+	vprintf(SDOG_EMERG fmt, ##args);	\
+	abort();				\
+})
+
 /* don't use the following obsolete functions. use vprintf instead. */
 
 #define eprintf(fmt, args...)						\
diff --git a/sheep/sheep_priv.h b/sheep/sheep_priv.h
index 9bedb2a..6409530 100644
--- a/sheep/sheep_priv.h
+++ b/sheep/sheep_priv.h
@@ -305,10 +305,4 @@ static inline int is_myself(uint8_t *addr, uint16_t port)
 		port == sys->this_node.port;
 }
 
-#define panic(fmt, args...)			\
-({						\
-	vprintf(SDOG_EMERG fmt, ##args);	\
-	exit(1);				\
-})
-
 #endif
-- 
1.7.2.5




More information about the sheepdog mailing list