From 72d99bb2f473313ea87be118aaaa6ff622e61739 Mon Sep 17 00:00:00 2001
From: Stephan Bosch <stephan@rename-it.nl>
Date: Tue, 7 Apr 2009 00:05:55 +0200
Subject: [PATCH] Adjusted to signal handler API changes in Dovecot.

---
 src/lib-sieve-tool/sieve-tool.c | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/src/lib-sieve-tool/sieve-tool.c b/src/lib-sieve-tool/sieve-tool.c
index 4e261f7b8..e02054593 100644
--- a/src/lib-sieve-tool/sieve-tool.c
+++ b/src/lib-sieve-tool/sieve-tool.c
@@ -27,16 +27,19 @@ static struct ioloop *ioloop;
  * Signal handlers
  */
 
-static void sig_die(int signo, void *context ATTR_UNUSED)
+static void sig_die(const siginfo_t *si, void *context ATTR_UNUSED)
 {
-	/* Warn about being killed because of some signal, except SIGINT (^C)
+	/* warn about being killed because of some signal, except SIGINT (^C)
 	 * which is too common at least while testing :) 
 	 */
-	if (signo != SIGINT)
-		i_warning("killed with signal %d", signo);
-
-	io_loop_stop(ioloop);	
-	exit(1);
+        if (si->si_signo != SIGINT) {
+		/* FIMXE: strange error for a command line tool */
+		i_warning("Killed with signal %d (by pid=%s uid=%s code=%s)",
+ 			si->si_signo, dec2str(si->si_pid),
+			dec2str(si->si_uid),
+			lib_signal_code_to_str(si->si_signo, si->si_code));
+        }
+        io_loop_stop(current_ioloop);
 }
 
 /*
-- 
GitLab