5bb745ec6fc63d0a9bf6dc045780cd897ecb6fdc
POSIX ftruncate(2) and futimens(2) do not close the file descriptor. The previous 'self' (by-value) signature consumed the Fd on call, which would trigger Fd::drop and close the fd as a side effect. After a successful ftruncate the user could no longer use the fd, which is the opposite of the intended semantics. Change to '&self' to match the surrounding methods (fsync, fdatasync both already use &self) and to match POSIX behaviour. The drop-on- failure semantics is preserved by Rust's normal borrow checker: if ftruncate returns Err, the caller's borrow is still valid and the fd stays open.
Description
RedBear Operating System, based on RedoxOS. Licenced under MIT license.
https://redbearos.org
Languages
C
37.5%
C++
37.2%
JavaScript
6.7%
QML
3.4%
HTML
3.2%
Other
11.4%