Skip to content

Commit

Permalink
main: refactor poll_method_best (coverity fix) (#449)
Browse files Browse the repository at this point in the history
  • Loading branch information
alfredh authored Jul 18, 2022
1 parent 2046716 commit c7bc6d9
Showing 1 changed file with 6 additions and 15 deletions.
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

0 comments on commit c7bc6d9

Please sign in to comment.