summaryrefslogtreecommitdiffstats
path: root/openbsc/src
diff options
context:
space:
mode:
authorHarald Welte <laforge@netfilter.org>2009-08-06 17:43:50 +0200
committerHarald Welte <laforge@netfilter.org>2009-08-06 17:43:50 +0200
commitf294f45ca6121006b44657ef26f130e126863414 (patch)
tree9dfb51e98b4f8684b41aad2b83cfbd51f68dbf01 /openbsc/src
parentd158605db1d5c406b55d3a1636c3e45dcd19decb (diff)
shut down the OML (and thus the BTS) when bsc_hack is terminated with ctrl+c
Diffstat (limited to 'openbsc/src')
-rw-r--r--openbsc/src/bsc_hack.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/openbsc/src/bsc_hack.c b/openbsc/src/bsc_hack.c
index 343131028..27c2c2536 100644
--- a/openbsc/src/bsc_hack.c
+++ b/openbsc/src/bsc_hack.c
@@ -676,6 +676,8 @@ static void bootstrap_om(struct gsm_bts *bts)
static int shutdown_om(struct gsm_bts *bts)
{
+ fprintf(stdout, "shutting down OML for BTS %u\n", bts->nr);
+
/* stop sending event reports */
abis_nm_event_reports(bts, 0);
@@ -1294,9 +1296,11 @@ static void signal_handler(int signal)
fprintf(stdout, "signal %u received\n", signal);
switch (signal) {
- case SIGHUP:
+ case SIGINT:
case SIGABRT:
shutdown_net(gsmnet);
+ sleep(3);
+ exit(0);
break;
case SIGUSR1:
talloc_report_full(tall_bsc_ctx, stderr);
@@ -1322,7 +1326,7 @@ int main(int argc, char **argv)
if (rc < 0)
exit(1);
- signal(SIGHUP, &signal_handler);
+ signal(SIGINT, &signal_handler);
signal(SIGABRT, &signal_handler);
signal(SIGUSR1, &signal_handler);