[network-manager-applet] applet: attempt at debugging spurious TERM handling (bgo #647726)



commit ae4ce453e217d3929b0a7f46d77da5914dcac875
Author: Dan Williams <dcbw redhat com>
Date:   Wed Apr 13 22:45:35 2011 -0500

    applet: attempt at debugging spurious TERM handling (bgo #647726)
    
    At least let us know what's sending the SIGTERM, if it's the applet
    or something else.

 src/main.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/src/main.c b/src/main.c
index e2c82a1..9b056bb 100644
--- a/src/main.c
+++ b/src/main.c
@@ -38,10 +38,11 @@
 static GMainLoop *loop = NULL;
 
 static void
-signal_handler (int signo)
+signal_handler (int signo, siginfo_t *info, void *data)
 {
 	if (signo == SIGINT || signo == SIGTERM) {
-		g_message ("Caught signal %d, shutting down...", signo);
+		g_message ("PID %d (we are %d) sent signal %d, shutting down...",
+		           info->si_pid, getpid (), signo);
 		g_main_loop_quit (loop);
 	}
 }
@@ -53,9 +54,9 @@ setup_signals (void)
 	sigset_t mask;
 
 	sigemptyset (&mask);
-	action.sa_handler = signal_handler;
+	action.sa_sigaction = signal_handler;
 	action.sa_mask = mask;
-	action.sa_flags = 0;
+	action.sa_flags = SA_SIGINFO;
 	sigaction (SIGTERM,  &action, NULL);
 	sigaction (SIGINT,  &action, NULL);
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]