This is merely a historical archive of years 2008-2021, before the migration to mailman3.
A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.
Vadim Yanitskiy gerrit-no-reply at lists.osmocom.orgVadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/10222
Change subject: hlr.c: move deinitialization code from SIGINT handler
......................................................................
hlr.c: move deinitialization code from SIGINT handler
There were a few lines of dead code below the osmo_select_main()
loop, while the actual deinitialization code was a part of SIGINT
handler. Let's reanimate this dead zone by moving the code there
and introducing a global 'loop-breaker' variable.
Change-Id: I0e2d673b420193e2bdc1a92377aca542f3a19229
---
M src/hlr.c
1 file changed, 7 insertions(+), 9 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/22/10222/1
diff --git a/src/hlr.c b/src/hlr.c
index 643dfff..7fdb27e 100644
--- a/src/hlr.c
+++ b/src/hlr.c
@@ -44,6 +44,7 @@
#include "hlr_vty.h"
static struct hlr *g_hlr;
+static int quit = 0;
/* Trigger 'Insert Subscriber Data' messages to all connected GSUP clients.
*
@@ -523,11 +524,7 @@
switch (signal) {
case SIGINT:
LOGP(DMAIN, LOGL_NOTICE, "Terminating due to SIGINT\n");
- osmo_gsup_server_destroy(g_hlr->gs);
- db_close(g_hlr->dbc);
- log_fini();
- talloc_report_full(hlr_ctx, stderr);
- exit(0);
+ quit++;
break;
case SIGUSR1:
LOGP(DMAIN, LOGL_DEBUG, "Talloc Report due to SIGUSR1\n");
@@ -621,13 +618,14 @@
}
}
- while (1) {
+ while (!quit)
osmo_select_main(0);
- }
+ osmo_gsup_server_destroy(g_hlr->gs);
db_close(g_hlr->dbc);
-
log_fini();
- exit(0);
+ talloc_report_full(hlr_ctx, stderr);
+
+ return 0;
}
--
To view, visit https://gerrit.osmocom.org/10222
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-hlr
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I0e2d673b420193e2bdc1a92377aca542f3a19229
Gerrit-Change-Number: 10222
Gerrit-PatchSet: 1
Gerrit-Owner: Vadim Yanitskiy <axilirator at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20180729/73acd77e/attachment.htm>