summaryrefslogtreecommitdiff
path: root/ev_iouring.c
diff options
context:
space:
mode:
authorMarc Alexander Lehmann <libev@schmorp.de>2019-07-09 00:04:35 +0000
committerMarc Alexander Lehmann <libev@schmorp.de>2019-07-09 00:04:35 +0000
commitde01eb22da25422e5ad58d3e90f76c492ca0df34 (patch)
tree1fc788e8177b04ccdcf981df1c3528d538de64d7 /ev_iouring.c
parent5c88c9c8d4f40bc65f2255a0226624ba995006fc (diff)
downloadlibev-de01eb22da25422e5ad58d3e90f76c492ca0df34.tar.gz
libev-de01eb22da25422e5ad58d3e90f76c492ca0df34.zip
*** empty log message ***
Diffstat (limited to 'ev_iouring.c')
-rw-r--r--ev_iouring.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/ev_iouring.c b/ev_iouring.c
index 65caaac..35b5913 100644
--- a/ev_iouring.c
+++ b/ev_iouring.c
@@ -381,17 +381,17 @@ iouring_modify (EV_P_ int fd, int oev, int nev)
sqe->fd = fd;
sqe->user_data = -1;
iouring_sqe_submit (EV_A_ sqe);
- }
- /* increment generation counter to avoid handling old events */
- ++anfds [fd].egen;
+ /* increment generation counter to avoid handling old events */
+ ++anfds [fd].egen;
+ }
if (nev)
{
struct io_uring_sqe *sqe = iouring_sqe_get (EV_A);
sqe->opcode = IORING_OP_POLL_ADD;
sqe->fd = fd;
- sqe->user_data = (uint32_t)fd | ((__u64)anfds [fd].egen << 32);
+ sqe->user_data = (uint32_t)fd | ((__u64)(uint32_t)anfds [fd].egen << 32);
sqe->poll_events =
(nev & EV_READ ? POLLIN : 0)
| (nev & EV_WRITE ? POLLOUT : 0);
@@ -444,7 +444,7 @@ iouring_process_cqe (EV_P_ struct io_uring_cqe *cqe)
/* ignore event if generation doesn't match */
/* this should actually be very rare */
- if (ecb_expect_false ((uint32_t)anfds [fd].egen != gen))
+ if (ecb_expect_false (gen != (uint32_t)anfds [fd].egen))
return;
if (ecb_expect_false (res < 0))