Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Main method best #449

Merged
merged 2 commits into from
Jul 18, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 6 additions & 15 deletions src/main/method.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,33 +24,24 @@ static const char str_kqueue[] = "kqueue";
*/
enum poll_method poll_method_best(void)
{
enum poll_method m = METHOD_NULL;

#ifdef HAVE_EPOLL
/* Supported from Linux 2.5.66 */
if (METHOD_NULL == m) {
m = METHOD_EPOLL;
}
return METHOD_EPOLL;
#endif

#ifdef HAVE_KQUEUE
if (METHOD_NULL == m) {
m = METHOD_KQUEUE;
}
return METHOD_KQUEUE;
#endif

#ifdef HAVE_POLL
if (METHOD_NULL == m) {
m = METHOD_POLL;
}
return METHOD_POLL;
#endif

#ifdef HAVE_SELECT
if (METHOD_NULL == m) {
m = METHOD_SELECT;
}
return METHOD_SELECT;
#endif

return m;
return METHOD_NULL;
}


Expand Down