While SIGINT (already handled) makes sense for interactive use, handling
SIGTERM in the same manner is less surprising for scripting. This lets
you do:
btrace ... & some workload; kill $!
and get the expected output.
ok mpi@
-/* $OpenBSD: btrace.c,v 1.62 2022/02/22 17:26:04 deraadt Exp $ */
+/* $OpenBSD: btrace.c,v 1.63 2022/06/02 21:38:46 jca Exp $ */
/*
* Copyright (c) 2019 - 2021 Martin Pieuchot <mpi@openbsd.org>
sa.sa_handler = signal_handler;
if (sigaction(SIGINT, &sa, NULL))
err(1, "sigaction");
+ if (sigaction(SIGTERM, &sa, NULL))
+ err(1, "sigaction");
rules_setup(fd);