Skip to content

Commit

Permalink
include/ruby/io.h: use 0 as POLLPRI when no support for it
Browse files Browse the repository at this point in the history
0x003 is not suitable as a bit mask, and it's ok just to be 0 to avoid
setting unsupported bit.
  • Loading branch information
kateinoigakukun authored and nobu committed Jan 19, 2022
1 parent 68e821c commit 8c21701
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions include/ruby/io.h
Expand Up @@ -35,11 +35,10 @@
# undef revents
# endif
# define RB_WAITFD_IN POLLIN
# if defined(__wasi__) && !defined(POLLPRI)
// wasi-libc doesn't have POLLPRI and 0x002 is already reserved for POLLOUT, so use 0x003
# define RB_WAITFD_PRI 0x003
# else
# if defined(POLLPRI)
# define RB_WAITFD_PRI POLLPRI
# else
# define RB_WAITFD_PRI 0
# endif
# define RB_WAITFD_OUT POLLOUT
#else
Expand Down

0 comments on commit 8c21701

Please sign in to comment.