Commit caecf2dd authored by Matthias Clasen's avatar Matthias Clasen Committed by Matthias Clasen

Add a check for broken poll on Mac OS X.

2006-12-12  Matthias Clasen  <mclasen@redhat.com>

        * configure.in: Add a check for broken poll on Mac OS X.

        * glib/gmain.c: Use poll emulation on OS X.  (#302672, Toby Peterson,
        patch by Dave Vasilevsky)
parent dc6f720c
2006-12-12 Matthias Clasen <mclasen@redhat.com>
* configure.in: Add a check for broken poll on Mac OS X.
* glib/gmain.c: Use poll emulation on OS X. (#302672, Toby Peterson,
patch by Dave Vasilevsky)
2006-12-11 Matthias Clasen <mclasen@redhat.com>
* glib/gatomic.c: Don't use local numeric labels in
......
......@@ -2117,6 +2117,32 @@ else
glib_cv_value_POLLNVAL=32
fi
# Check for Mac OS X's broken poll
if test $cross_compiling != yes ; then
AC_MSG_CHECKING(for broken poll)
AC_TRY_RUN([[
#include <stdlib.h>
#include <fcntl.h>
#include <poll.h>
int main(void) {
struct pollfd fds[1];
int fd;
fd = open("/dev/null", 1);
fds[0].fd = fd;
fds[0].events = POLLIN;
fds[0].revents = 0;
if (poll(fds, 1, 0) < 0 || (fds[0].revents & POLLNVAL) != 0) {
exit(1); /* Does not work for devices -- fail */
}
exit(0);
}]],
broken_poll=no,
broken_poll=yes
AC_DEFINE(BROKEN_POLL,1,[poll doesn't work on devices])
)
AC_MSG_RESULT($broken_poll)
fi
dnl **********************
dnl *** Win32 API libs ***
dnl **********************
......
......@@ -53,7 +53,7 @@
/* The poll() emulation on OS/X doesn't handle fds=NULL, nfds=0,
* so we prefer our own poll emulation.
*/
#ifdef _POLL_EMUL_H_
#if defined(_POLL_EMUL_H_) || defined(BROKEN_POLL)
#undef HAVE_POLL
#endif
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment