aboutsummaryrefslogtreecommitdiffstats
path: root/src/app_osmo_gapk.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/app_osmo_gapk.c')
-rw-r--r--src/app_osmo_gapk.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/app_osmo_gapk.c b/src/app_osmo_gapk.c
index 4c13570..d02ccbe 100644
--- a/src/app_osmo_gapk.c
+++ b/src/app_osmo_gapk.c
@@ -67,8 +67,8 @@ struct gapk_options
struct gapk_state
{
struct gapk_options opts;
-
struct osmo_gapk_pq *pq;
+ int exit;
struct {
struct {
@@ -622,7 +622,11 @@ run(struct gapk_state *gs)
if (rv)
return rv;
- for (frames=0; !(rv = osmo_gapk_pq_execute(gs->pq)); frames++);
+ for (frames = 0; !gs->exit; frames++) {
+ rv = osmo_gapk_pq_execute(gs->pq);
+ if (rv)
+ break;
+ }
LOGP(DAPP, LOGL_NOTICE, "Processed %d frames\n", frames);
@@ -649,11 +653,14 @@ static void app_shutdown(void)
static void signal_handler(int signal)
{
+ fprintf(stderr, "signal %u received\n", signal);
+
switch (signal) {
case SIGINT:
- fprintf(stderr, "catching sigint, shutting down...\n");
- app_shutdown();
- exit(0);
+ if (gs->exit++) {
+ app_shutdown();
+ exit(0);
+ }
break;
default:
break;