1
1

Completely remove the kqueue support on MAC OS X. Remove the test

from kqueue that try to detect if kqueue might works with ptys.

This commit was SVN r18411.
Этот коммит содержится в:
George Bosilca 2008-05-08 02:33:23 +00:00
родитель 60f39a30f6
Коммит fe495e429a
2 изменённых файлов: 13 добавлений и 69 удалений

Просмотреть файл

@ -212,7 +212,19 @@ fi
havekqueue=no
if test "x$ac_cv_header_sys_event_h" = "xyes"; then
AC_CHECK_FUNCS(kqueue, [havekqueue=yes], )
# All versions of MAC OS X before at least 10.5.2 are
# completely broken when kqueue is used with pty. So, until
# they get fixed, completely disable kqueue on MAC OS X.
case "$host" in
*apple-darwin*)
AC_MSG_CHECKING(for working kqueue)
havekqueue="no"
AC_MSG_RESULT([no (MAC OS X)])
;;
*)
AC_CHECK_FUNCS(kqueue, [havekqueue=yes], )
;;
esac
if test "x$havekqueue" = "xyes" ; then
AC_MSG_CHECKING(for working kqueue)
AC_TRY_RUN(

Просмотреть файл

@ -166,74 +166,6 @@ kq_init(struct event_base *base)
close(kq);
return (NULL);
}
/* Check if the kqueue can support pty */
{
int master, slave;
char name[1024];
if( 0 > openpty( &master, &slave, name, NULL, NULL ) ) {
event_warn("%s: unable to call openpty: error %d (%s)\n",
__func__, errno, strerror(errno) );
free(kqueueop->changes);
free(kqueueop->events);
free(kqueueop);
close(kq);
return NULL;
}
kqueueop->changes[0].ident = master;
kqueueop->changes[0].filter = EVFILT_READ;
kqueueop->changes[0].flags = EV_ADD;
if (kevent(kq,
kqueueop->changes, 1, kqueueop->events, NEVENT, NULL) != 1 ||
(int)kqueueop->events[0].ident != master ||
kqueueop->events[0].flags != EV_ERROR) {
event_warn("%s: detected broken kqueue (failed add); not using error %d (%s)\n",
__func__, errno, strerror(errno));
free(kqueueop->changes);
free(kqueueop->events);
free(kqueueop);
close(kq);
close(master);
close(slave);
return (NULL);
}
kqueueop->changes[0].ident = master;
kqueueop->changes[0].filter = EVFILT_READ;
kqueueop->changes[0].flags = EV_DELETE;
if (kevent(kq,
kqueueop->changes, 1, kqueueop->events, NEVENT, NULL) != 1 ||
(int)kqueueop->events[0].ident != master ||
kqueueop->events[0].flags != EV_ERROR) {
event_warn("%s: detected broken kqueue (failed delete); not using error %d (%s)",
__func__, errno, strerror(errno));
free(kqueueop->changes);
free(kqueueop->events);
free(kqueueop);
close(kq);
close(master);
close(slave);
return (NULL);
}
kqueueop->changes[0].ident = master;
kqueueop->changes[0].filter = EVFILT_READ;
kqueueop->changes[0].flags = EV_DELETE;
if (kevent(kq,
kqueueop->changes, 1, kqueueop->events, NEVENT, NULL) != 1 ||
(int)kqueueop->events[0].ident != master ||
kqueueop->events[0].flags != EV_ERROR) {
event_warn("%s: detected broken kqueue (failed delete); not using error %d (%s)",
__func__, errno, strerror(errno));
free(kqueueop->changes);
free(kqueueop->events);
free(kqueueop);
close(kq);
close(master);
close(slave);
return (NULL);
}
close(master);
close(slave);
}
return (kqueueop);
}