ifdef SIGIO handling

This relies on POLL_IN which apparently isn't a thing on OpenBSD
This commit is contained in:
Fabian Homborg 2020-10-06 16:55:41 +02:00
parent 289bce2f25
commit e949b1de02
2 changed files with 4 additions and 1 deletions

View File

@ -1574,7 +1574,8 @@ class universal_notifier_named_pipe_t final : public universal_notifier_t {
universal_notifier_t::notifier_strategy_t universal_notifier_t::resolve_default_strategy() { universal_notifier_t::notifier_strategy_t universal_notifier_t::resolve_default_strategy() {
#ifdef FISH_NOTIFYD_AVAILABLE #ifdef FISH_NOTIFYD_AVAILABLE
return strategy_notifyd; return strategy_notifyd;
#elif defined(SIGIO) // Note: We use POLL_IN to query SIGIO information, without it it is useless.
#elif defined(SIGIO) && defined(POLL_IN)
return strategy_sigio; return strategy_sigio;
#elif defined(__CYGWIN__) #elif defined(__CYGWIN__)
return strategy_shmem_polling; return strategy_shmem_polling;

View File

@ -276,6 +276,7 @@ static void fish_signal_handler(int sig, siginfo_t *info, void *context) {
// test, to verify that we behave correctly when receiving lots of irrelevant signals. // test, to verify that we behave correctly when receiving lots of irrelevant signals.
break; break;
#if defined(SIGIO) && defined(POLL_IN)
case SIGIO: case SIGIO:
// An async FD became readable/writable/etc. // An async FD became readable/writable/etc.
if (info->si_code == POLL_IN) { if (info->si_code == POLL_IN) {
@ -283,6 +284,7 @@ static void fish_signal_handler(int sig, siginfo_t *info, void *context) {
s_signal_pollin_count = s_signal_pollin_count + 1; s_signal_pollin_count = s_signal_pollin_count + 1;
} }
break; break;
#endif
} }
errno = saved_errno; errno = saved_errno;
} }