Introduce new S_GLOBAL_SHUTDOWN signal
This is used to notify various parts of OpenBSC that we're shutting
down.
diff --git a/openbsc/include/openbsc/signal.h b/openbsc/include/openbsc/signal.h
index 5156fcb..d59bb97 100644
--- a/openbsc/include/openbsc/signal.h
+++ b/openbsc/include/openbsc/signal.h
@@ -40,6 +40,7 @@
SS_LCHAN,
SS_SUBSCR,
SS_SCALL,
+ SS_GLOBAL,
};
/* SS_PAGING signals */
@@ -99,6 +100,10 @@
S_SCALL_DETACHED,
};
+enum signal_global {
+ S_GLOBAL_SHUTDOWN,
+};
+
typedef int signal_cbfn(unsigned int subsys, unsigned int signal,
void *handler_data, void *signal_data);
diff --git a/openbsc/src/bsc_hack.c b/openbsc/src/bsc_hack.c
index c256f86..ee37a61 100644
--- a/openbsc/src/bsc_hack.c
+++ b/openbsc/src/bsc_hack.c
@@ -35,6 +35,7 @@
#include <openbsc/debug.h>
#include <openbsc/e1_input.h>
#include <openbsc/talloc.h>
+#include <openbsc/signal.h>
/* MCC and MNC for the Location Area Identifier */
struct gsm_network *bsc_gsmnet = 0;
@@ -143,6 +144,7 @@
switch (signal) {
case SIGINT:
bsc_shutdown_net(bsc_gsmnet);
+ dispatch_signal(SS_GLOBAL, S_GLOBAL_SHUTDOWN, NULL);
sleep(3);
exit(0);
break;