diff --git a/config/ompi_setup_libevent.m4 b/config/ompi_setup_libevent.m4 index ae890f0b11..95ac5ecb8b 100644 --- a/config/ompi_setup_libevent.m4 +++ b/config/ompi_setup_libevent.m4 @@ -78,7 +78,21 @@ fi havepoll=no havertsig=no AC_CHECK_FUNCS(poll, [havepoll=yes], ) -if test "x$havepoll" = "xyes" ; then +case "$host" in + *apple-darwin*) + haveworkingpoll=0 + ;; + *) + if test "$havepoll" = "yes" ; then + haveworkingpoll=1 + else + haveworkingpoll=0 + fi + ;; +esac +AC_DEFINE_UNQUOTED([HAVE_WORKING_POLL], [$haveworkingpoll], + [Whether poll works for file descriptors and devices]) +if test "x$havepoll" = "xyes" -a "$haveworkingpoll" = "1" ; then # OMPI: Don't use AC_LIBOBJ sources="poll.c $sources" needsignal=yes diff --git a/src/event/event.c b/src/event/event.c index 9c155d4506..6818324faf 100644 --- a/src/event/event.c +++ b/src/event/event.c @@ -69,7 +69,7 @@ #if defined(HAVE_SELECT) && HAVE_SELECT extern const struct ompi_eventop ompi_selectops; #endif -#if defined(HAVE_POLL) && HAVE_POLL +#if defined(HAVE_POLL) && HAVE_POLL && HAVE_WORKING_POLL extern const struct ompi_eventop ompi_pollops; #endif #if defined(HAVE_RTSIG) && HAVE_RTSIG @@ -104,7 +104,7 @@ static const struct ompi_eventop *ompi_eventops[] = { &ompi_rtsigops, #endif #endif -#if defined(HAVE_POLL) && HAVE_POLL +#if defined(HAVE_POLL) && HAVE_POLL && HAVE_WORKING_POLL &ompi_pollops, #endif #if defined(HAVE_SELECT) && HAVE_SELECT