Patch, extracted from my upstream merge proposal.
From 95bc8aca4aae7f596b84566f73101b0531a2c730 Mon Sep 17 00:00:00 2001
From: Jelmer Vernooij <jel...@samba.org>
Date: Sat, 18 Jan 2014 21:33:39 +0000
Subject: [PATCH] Fix handling of SIGINT/SIGTERM in kcm.

Debian-Bug: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=654349
---
 kcm/main.c | 16 +---------------
 1 file changed, 1 insertion(+), 15 deletions(-)

diff --git a/kcm/main.c b/kcm/main.c
index 71681bd..eb836ed 100644
--- a/kcm/main.c
+++ b/kcm/main.c
@@ -35,19 +35,11 @@
 
 RCSID("$Id$");
 
-sig_atomic_t exit_flag = 0;
-
 krb5_context kcm_context = NULL;
 
 const char *service_name = "org.h5l.kcm";
 
 static RETSIGTYPE
-sigterm(int sig)
-{
-    exit_flag = 1;
-}
-
-static RETSIGTYPE
 sigusr1(int sig)
 {
     kcm_debug_ccache(kcm_context);
@@ -78,13 +70,9 @@ main(int argc, char **argv)
 	struct sigaction sa;
 
 	sa.sa_flags = 0;
-	sa.sa_handler = sigterm;
+	sa.sa_handler = sigusr1;
 	sigemptyset(&sa.sa_mask);
 
-	sigaction(SIGINT, &sa, NULL);
-	sigaction(SIGTERM, &sa, NULL);
-
-	sa.sa_handler = sigusr1;
 	sigaction(SIGUSR1, &sa, NULL);
 
 	sa.sa_handler = sigusr2;
@@ -94,8 +82,6 @@ main(int argc, char **argv)
 	sigaction(SIGPIPE, &sa, NULL);
     }
 #else
-    signal(SIGINT, sigterm);
-    signal(SIGTERM, sigterm);
     signal(SIGUSR1, sigusr1);
     signal(SIGUSR2, sigusr2);
     signal(SIGPIPE, SIG_IGN);
-- 
1.8.5.3

Attachment: signature.asc
Description: Digital signature

Reply via email to