From 16e272ea4bcfbdc5aa3a0e36e9a3d3a639af4473 Mon Sep 17 00:00:00 2001 From: Zahari Dichev Date: Tue, 20 Oct 2020 18:42:32 +0300 Subject: fs: flush on shutdown (#3009) Fixes: #2950 --- tokio/src/fs/file.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'tokio/src/fs') diff --git a/tokio/src/fs/file.rs b/tokio/src/fs/file.rs index 8b385117..7c71f483 100644 --- a/tokio/src/fs/file.rs +++ b/tokio/src/fs/file.rs @@ -682,9 +682,8 @@ impl AsyncWrite for File { inner.poll_flush(cx) } - fn poll_shutdown(self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll> { - // Flush is a noop for files so it's fine not to call it. - Poll::Ready(Ok(())) + fn poll_shutdown(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { + self.poll_flush(cx) } } -- cgit v1.2.3