summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2022-12-22 15:12:01 +0200
committerTimo Teräs <timo.teras@iki.fi>2022-12-22 15:14:41 +0200
commit6508596be6b2e4c897034dcef72e9df09502f419 (patch)
tree2937a74d6477d7171bb130f5bdb1c3f1c6bf5439
parentb56eeb2ce0da9256f6faacb2d3dbe7af6799fd51 (diff)
downloadapk-tools-6508596be6b2e4c897034dcef72e9df09502f419.tar.gz
apk-tools-6508596be6b2e4c897034dcef72e9df09502f419.tar.bz2
apk-tools-6508596be6b2e4c897034dcef72e9df09502f419.tar.xz
apk-tools-6508596be6b2e4c897034dcef72e9df09502f419.zip
apk: ignore SIGINT after applet is executed
apk_db_close is not re-entrant, and would be executed by the signal handler. It makes sense to just ignore the signal after applet is complete as the clean up work has been started already. fixes #10840
-rw-r--r--src/apk.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/apk.c b/src/apk.c
index 27a9f07..045a094 100644
--- a/src/apk.c
+++ b/src/apk.c
@@ -550,6 +550,7 @@ int main(int argc, char **argv)
memcpy(args->item, argv, argc * sizeof(*argv));
r = applet->main(applet_ctx, &ctx, args);
+ signal(SIGINT, SIG_IGN);
apk_db_close(&db);
#ifdef TEST_MODE