From 887289e5d455d2cd026a2b178002ed009ea8bdd4 Mon Sep 17 00:00:00 2001 From: Dylan Reid Date: Fri, 24 Apr 2020 03:51:19 +0000 Subject: cros_async: allow wakers to be canceled Allowing for wakers to be canceled will allow futures that register wakers properly implement `Drop`. As it is, they won't ever fire but the saved FD will leak. TEST=added 'cancel' unit test to fd_executor: "cargo test cancel" from the cros_async directory. Change-Id: Iab5bea6aac0cc689392997745f5dcc8c285200d9 Change-Id: I1df1a04897e8d2c5e9c414d84998084607209fb9 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2164074 Reviewed-by: Chirantan Ekbote Commit-Queue: Dylan Reid Tested-by: Dylan Reid --- async_core/src/eventfd.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'async_core') diff --git a/async_core/src/eventfd.rs b/async_core/src/eventfd.rs index b930f07..fdff83e 100644 --- a/async_core/src/eventfd.rs +++ b/async_core/src/eventfd.rs @@ -109,7 +109,7 @@ impl Stream for EventFd { .or_else(|e| { if e.errno() == EWOULDBLOCK { add_read_waker(self.inner.as_raw_fd(), cx.waker().clone()) - .map(|()| Poll::Pending) + .map(|_token| Poll::Pending) .map_err(Error::AddingWaker) } else { Err(Error::EventFdRead(e)) -- cgit 1.4.1