[Sheepdog] [PATCH] logger: correct crash_handler output

Liu Yuan namei.unix at gmail.com
Sat Apr 28 14:46:58 CEST 2012


From: Liu Yuan <tailai.ly at taobao.com>

'pid' is always 0 in logger process. So it is useless to
output it.

- fix logger pid output.

Signed-off-by: Liu Yuan <tailai.ly at taobao.com>
---
 lib/logger.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/logger.c b/lib/logger.c
index 05e62a0..e9c773c 100644
--- a/lib/logger.c
+++ b/lib/logger.c
@@ -385,10 +385,10 @@ static notrace void crash_handler(int signo)
 		vprintf(SDOG_ERR, "logger pid %d segfaulted.\n",
 			getpid());
 	} else if (signo == SIGHUP) {
-		vprintf(SDOG_ERR, "sheep pid %d exited unexpectedly.\n", pid);
+		vprintf(SDOG_ERR, "sheep exited unexpectedly.\n");
 	} else {
 		vprintf(SDOG_ERR, "logger pid %d got unexpected signal %d.\n",
-			pid, signo);
+			getpid(), signo);
 	}
 
 	log_flush();
-- 
1.7.8.2




More information about the sheepdog mailing list