# HG changeset patch # User Sebastien Decugis # Date 1295331194 -32400 # Node ID d59effdf525645f55806ef2223f752042a6dbecd # Parent 1250381f7b7b1ca749dd02dae48eaddfb83760de Improve management of the signals in freeDiameterd diff -r 1250381f7b7b -r d59effdf5256 contrib/debian/changelog --- 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 Tue, 18 Jan 2011 14:53:52 +0900 + -- Sebastien Decugis Tue, 18 Jan 2011 15:13:00 +0900 freediameter (1.0.4) UNRELEASED; urgency=low diff -r 1250381f7b7b -r d59effdf5256 freeDiameterd/main.c --- 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;