Skip to content

Commit

Permalink
fix(epoll): use duplicated fd to cancel completion
Browse files Browse the repository at this point in the history
  • Loading branch information
Corendos committed Nov 7, 2023
1 parent 59e337c commit efcd521
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/backend/epoll.zig
Original file line number Diff line number Diff line change
Expand Up @@ -728,7 +728,8 @@ pub const Loop = struct {

fn stop_completion(self: *Loop, completion: *Completion) void {
// Delete. This should never fail.
if (completion.fd()) |fd| {
const maybe_fd = if (completion.flags.dup) completion.flags.dup_fd else completion.fd();
if (maybe_fd) |fd| {
std.os.epoll_ctl(
self.fd,
linux.EPOLL.CTL_DEL,
Expand Down

0 comments on commit efcd521

Please sign in to comment.