changeset 683:d59effdf5256

Improve management of the signals in freeDiameterd
author Sebastien Decugis <sdecugis@nict.go.jp>
date Tue, 18 Jan 2011 15:13:14 +0900
parents 1250381f7b7b
children 63b15104d124
files contrib/debian/changelog freeDiameterd/main.c
diffstat 2 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/contrib/debian/changelog	Tue Jan 18 14:56:01 2011 +0900
+++ b/contrib/debian/changelog	Tue Jan 18 15:13:14 2011 +0900
@@ -10,8 +10,10 @@
   * Cleanups in links to shared libraries
   * (app_radgw.fdx) Better handling conversion of DEA with error status
     to RADIUS (closes #25)
+  * Allow default signals such as SIGTSTP (ctrl-z) to be used with
+    freeDiameterd
 
- -- Sebastien Decugis <sdecugis@nict.go.jp>  Tue, 18 Jan 2011 14:53:52 +0900
+ -- Sebastien Decugis <sdecugis@nict.go.jp>  Tue, 18 Jan 2011 15:13:00 +0900
 
 freediameter (1.0.4) UNRELEASED; urgency=low
 
--- a/freeDiameterd/main.c	Tue Jan 18 14:56:01 2011 +0900
+++ b/freeDiameterd/main.c	Tue Jan 18 15:13:14 2011 +0900
@@ -61,7 +61,7 @@
 	int ret;
 	sigset_t sig_all;
 	
-	/* Block all signals from the current thread and all its future children */
+	/* Block all signals from the current thread and all its future children -- we will catch everything in catch_signals */
 	sigfillset(&sig_all);
 	ret = pthread_sigmask(SIG_BLOCK, &sig_all, NULL);
 	ASSERT(ret == 0);
@@ -269,6 +269,9 @@
 	sigaddset(&ss, SIGUSR1);
 	sigaddset(&ss, SIGUSR2);
 	
+	/* We unblock all other signals, so that their default handler is used (such as SIGTSTP) */
+	CHECK_SYS_DO( pthread_sigmask( SIG_SETMASK, &ss, NULL ), goto out );
+	
 	/* Now loop on the reception of the signal */
 	while (1) {
 		int sig, *ps;
"Welcome to our mercurial repository"