signal-util: add common implementation for propagating a signal

i.e. let's add a common logic to be called from a signal handler to
raise the passed signal again.

Follow-up for: #25399
This commit is contained in:
Lennart Poettering
2022-11-17 22:38:14 +09:00
committed by Yu Watanabe
parent 58dad4d5e5
commit 128a11ea99
4 changed files with 26 additions and 10 deletions
+2 -2
View File
@@ -10,6 +10,7 @@
#include "missing_syscall.h"
#include "process-util.h"
#include "sigbus.h"
#include "signal-util.h"
#define SIGBUS_QUEUE_MAX 64
@@ -102,8 +103,7 @@ static void sigbus_handler(int sn, siginfo_t *si, void *data) {
if (si->si_code != BUS_ADRERR || !si->si_addr) {
assert_se(sigaction(SIGBUS, &old_sigaction, NULL) == 0);
if (rt_tgsigqueueinfo(getpid_cached(), gettid(), SIGBUS, si) < 0)
(void) raise(SIGBUS);
propagate_signal(sn, si);
return;
}