mirror of
https://github.com/neondatabase/neon.git
synced 2026-01-15 09:22:55 +00:00
Use with_std_file method in ftruncate implementation
Co-Authored-By: christian@neon.tech <christian@neon.tech>
This commit is contained in:
@@ -206,9 +206,8 @@ impl Handle {
|
||||
len: u64,
|
||||
) -> (F, Result<(), tokio_epoll_uring::Error<std::io::Error>>) {
|
||||
|
||||
let std_file = std::fs::File::from(file.as_fd());
|
||||
let res = std_file.set_len(len);
|
||||
let res = file.with_std_file(|std_file| std_file.set_len(len));
|
||||
|
||||
(file, res.map_err(tokio_epoll_uring::Error::from))
|
||||
(file, res.map_err(tokio_epoll_uring::Error::System))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user