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:12:01 +0200
commitb75ffff1551cf100e879e5aca3404b947a540581 (patch)
tree06b7d061c2404af4497c02b495b8dc37b85c57a5
parent101c8684ac7e924bf9097e8cff4c88e3f0eb7923 (diff)
downloadapk-tools-b75ffff1551cf100e879e5aca3404b947a540581.tar.gz
apk-tools-b75ffff1551cf100e879e5aca3404b947a540581.tar.bz2
apk-tools-b75ffff1551cf100e879e5aca3404b947a540581.tar.xz
apk-tools-b75ffff1551cf100e879e5aca3404b947a540581.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 94520c1..0c8286c 100644
--- a/src/apk.c
+++ b/src/apk.c
@@ -557,6 +557,7 @@ int main(int argc, char **argv)
memcpy(args->item, argv, argc * sizeof(*argv));
r = applet->main(ctx, &db, args);
+ signal(SIGINT, SIG_IGN);
apk_db_close(&db);
#ifdef TEST_MODE