changeset 97:00e36de5dcc4

Resolved signal conflict
author Sebastien Decugis <sdecugis@nict.go.jp>
date Tue, 08 Dec 2009 10:55:57 +0900
parents 38cc42c97420
children d5951258be1b
files extensions/app_test/app_test.c extensions/app_test/app_test.h extensions/dbg_monitor/monitor.c
diffstat 3 files changed, 15 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/extensions/app_test/app_test.c	Tue Dec 08 10:49:52 2009 +0900
+++ b/extensions/app_test/app_test.c	Tue Dec 08 10:55:57 2009 +0900
@@ -38,6 +38,7 @@
  */
 
 #include "app_test.h"
+#include <signal.h>
 
 /* Initialize the configuration */
 struct atst_conf * atst_conf = NULL;
@@ -56,7 +57,7 @@
 	atst_conf->mode       = MODE_SERV | MODE_CLI;
 	atst_conf->dest_realm = strdup(fd_g_config->cnf_diamrlm);
 	atst_conf->dest_host  = NULL;
-	atst_conf->signal     = 10; /* SIGUSR1 */
+	atst_conf->signal     = APP_TEST_DEFAULT_SIGNAL;
 	
 	return 0;
 }
--- a/extensions/app_test/app_test.h	Tue Dec 08 10:49:52 2009 +0900
+++ b/extensions/app_test/app_test.h	Tue Dec 08 10:55:57 2009 +0900
@@ -42,6 +42,11 @@
  
 #include <freeDiameter/extension.h>
 
+#ifndef APP_TEST_DEFAULT_SIGNAL
+#define APP_TEST_DEFAULT_SIGNAL	SIGUSR1
+#endif /* APP_TEST_DEFAULT_SIGNAL */
+
+
 /* Mode for the extension */
 #define MODE_SERV	0x1
 #define	MODE_CLI	0x2
@@ -55,7 +60,7 @@
 	int		mode;		/* default MODE_SERV | MODE_CLI */
 	char 	*	dest_realm;	/* default local realm */
 	char 	*	dest_host;	/* default NULL */
-	int 		signal;		/* default SIGUSR1 */
+	int 		signal;		/* default APP_TEST_DEFAULT_SIGNAL */
 };
 extern struct atst_conf * atst_conf;
 
--- a/extensions/dbg_monitor/monitor.c	Tue Dec 08 10:49:52 2009 +0900
+++ b/extensions/dbg_monitor/monitor.c	Tue Dec 08 10:55:57 2009 +0900
@@ -35,12 +35,16 @@
 
 /* Monitoring extension:
  - periodically display queues and peers information
- - upon SIGUSR1, display additional debug information
+ - upon SIGUSR2, display additional debug information
  */
 
 #include <freeDiameter/extension.h>
 #include <signal.h>
 
+#ifndef MONITOR_SIGNAL
+#define MONITOR_SIGNAL	SIGUSR2
+#endif /* MONITOR_SIGNAL */
+
 static int 	 monitor_main(char * conffile);
 
 EXTENSION_ENTRY("monitor", monitor_main);
@@ -63,9 +67,9 @@
 	/* Catch signal SIGUSR1 */
 	memset(&act, 0, sizeof(act));
 	act.sa_handler = got_sig;
-	CHECK_SYS_DO( sigaction(SIGUSR1, &act, NULL), /* conitnue */ );
+	CHECK_SYS_DO( sigaction(MONITOR_SIGNAL, &act, NULL), /* conitnue */ );
 	sigemptyset(&sig);
-	sigaddset(&sig, SIGUSR1);
+	sigaddset(&sig, MONITOR_SIGNAL);
 	CHECK_POSIX_DO(  pthread_sigmask(SIG_UNBLOCK, &sig, NULL), /* conitnue */  );
 	
 	/* Loop */
"Welcome to our mercurial repository"