From a6b8251d68d0fb5ff125fe347360606218d62bce Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Fri, 16 Dec 2022 10:35:58 +0100 Subject: [PATCH] Clear epoll flags in callbacks --- ev/+linux/io.ha | 2 ++ ev/+linux/socket.ha | 1 + diff --git a/ev/+linux/io.ha b/ev/+linux/io.ha index 999d24fa60a07f4a1376259fb068ceb7e421fb43..1be01d3c43c3212b2d14aed9207429ad565bc363 100644 --- a/ev/+linux/io.ha +++ b/ev/+linux/io.ha @@ -42,6 +42,7 @@ assert(ev.events & (rt::EPOLLIN | rt::EPOLLHUP) != 0); assert(file.cb != null); const cb = file.cb: *readcb; file.op = op::NONE; + filemod(file, 0); if (ev.events & rt::EPOLLHUP != 0) { cb(file, io::EOF); @@ -94,5 +95,6 @@ assert(file.cb != null); const r = io::writev(file.fd, file.vec...); const cb = file.cb: *writecb; file.op = op::NONE; + filemod(file, 0); cb(file, r); }; diff --git a/ev/+linux/socket.ha b/ev/+linux/socket.ha index cf11b88fcf1d4bcbb3cca27fd836f142e2610035..965ebaadcf163e4effef966bfbebb916cf8200cd 100644 --- a/ev/+linux/socket.ha +++ b/ev/+linux/socket.ha @@ -46,6 +46,7 @@ assert(ev.events & rt::EPOLLIN != 0); assert(sock.cb != null); const cb = sock.cb: *acceptcb; sock.op = op::NONE; + filemod(sock, 0); const r = tcp::accept(sock.fd, sock.sockflags); match (r) { -- 2.48.1