int success = BEV_EVENT_CONNECTED;
int default_error = 0;
unsigned i;
+ int ret;
if (emfile) {
success = BEV_EVENT_ERROR;
#elif defined(__sun__)
/* on solaris it returns EAI_FAIL */
default_error = EVUTIL_EAI_FAIL;
+ /** the DP_POLL can also fail with EINVAL under EMFILE */
#else
/* on osx/freebsd it returns EAI_NONAME */
default_error = EVUTIL_EAI_NONAME;
tt_assert(!bufferevent_socket_connect_hostname(be[2], dns, AF_INET,
"nobodaddy.example.com", listener_port));
- event_base_dispatch(data->base);
+ ret = event_base_dispatch(data->base);
+#ifdef __sun__
+ if (emfile && !strcmp(event_base_get_method(data->base), "devpoll")) {
+ tt_int_op(ret, ==, -1);
+ /** DP_POLL failed */
+ tt_skip();
+ } else
+#endif
+ {
+ tt_int_op(ret, ==, 0);
+ }
tt_int_op(be_outcome[0].what, ==, BEV_EVENT_ERROR);
tt_int_op(be_outcome[0].dnserr, ==, EVUTIL_EAI_NONAME);