Fix up SIGIO notifier tests

FreeBSD has the behavior where SIGIO is delivered on a read. Teach the
tests how to handle this behavior.
This commit is contained in:
ridiculousfish 2020-10-25 13:49:09 -07:00
parent 8bb20a8d91
commit e669c41d1b

View file

@ -3867,6 +3867,12 @@ static void test_notifiers_with_strategy(universal_notifier_t::notifier_strategy
// Nobody should poll now.
for (size_t i = 0; i < notifier_count; i++) {
// On BSD, SIGIO may be delivered by read() even if it returns EAGAIN;
// that is the polling itself may trigger a SIGIO. Therefore we poll twice.
if (strategy == universal_notifier_t::strategy_sigio) {
(void)poll_notifier(notifiers[i]);
}
if (poll_notifier(notifiers[i])) {
err(L"Universal variable notifier polled true after all changes, with strategy %d",
(int)strategy);