assert(addr);
/* Find a free place, increase the number of entries and leave, if we can */
- for (size_t u = 0; u < SIGBUS_QUEUE_MAX; u++) {
+ FOREACH_ELEMENT(u, sigbus_queue) {
/* OK to initialize this here since we haven't started the atomic ops yet */
void *tmp = NULL;
- if (__atomic_compare_exchange_n(&sigbus_queue[u], &tmp, addr, false,
+ if (__atomic_compare_exchange_n(u, &tmp, addr, false,
__ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST)) {
__atomic_fetch_add(&n_sigbus_queue, 1, __ATOMIC_SEQ_CST);
return;
assert(si);
if (si->si_code != BUS_ADRERR || !si->si_addr) {
- assert_se(sigaction(SIGBUS, &old_sigaction, NULL) == 0);
+ assert_se(sigaction(SIGBUS, &old_sigaction, NULL) >= 0);
propagate_signal(sn, si);
return;
}
n_installed++;
if (n_installed == 1)
- assert_se(sigaction(SIGBUS, &sa, &old_sigaction) == 0);
+ assert_se(sigaction(SIGBUS, &sa, &old_sigaction) >= 0);
return;
}
n_installed--;
if (n_installed == 0)
- assert_se(sigaction(SIGBUS, &old_sigaction, NULL) == 0);
+ assert_se(sigaction(SIGBUS, &old_sigaction, NULL) >= 0);
return;
}