diff options
author | Zahari Dichev <zaharidichev@gmail.com> | 2020-10-20 18:42:32 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-20 17:42:32 +0200 |
commit | 16e272ea4bcfbdc5aa3a0e36e9a3d3a639af4473 (patch) | |
tree | fd7a23874a93ad1a45d788d7dc6b5352573aa4ed /tokio/src/fs | |
parent | 6d99e1c7dec4c6a37c4c7bf2801bc82cc210351d (diff) |
fs: flush on shutdown (#3009)
Fixes: #2950
Diffstat (limited to 'tokio/src/fs')
-rw-r--r-- | tokio/src/fs/file.rs | 5 |
1 files changed, 2 insertions, 3 deletions
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<Result<(), io::Error>> { - // 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<Result<(), io::Error>> { + self.poll_flush(cx) } } |