Skip to content

Commit b5a129a

Browse files
Merge #1201
1201: Fix fallocate signature r=asomers a=DianaNites Fixes #1200 Co-authored-by: Diana <[email protected]>
2 parents 5c3fbbb + 9064823 commit b5a129a

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
1717
- Derived `Ord`, `PartialOrd` for `unistd::Pid` (#[1189](https://github.com/nix-rust/nix/pull/1189))
1818

1919
### Changed
20+
- Changed `fallocate` return type from `c_int` to `()` (#[1201](https://github.com/nix-rust/nix/pull/1201))
2021
### Fixed
2122
### Removed
2223

src/fcntl.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -468,9 +468,9 @@ libc_bitflags!(
468468
/// Allows the caller to directly manipulate the allocated disk space for the
469469
/// file referred to by fd.
470470
#[cfg(any(target_os = "linux"))]
471-
pub fn fallocate(fd: RawFd, mode: FallocateFlags, offset: libc::off_t, len: libc::off_t) -> Result<c_int> {
471+
pub fn fallocate(fd: RawFd, mode: FallocateFlags, offset: libc::off_t, len: libc::off_t) -> Result<()> {
472472
let res = unsafe { libc::fallocate(fd, mode.bits(), offset, len) };
473-
Errno::result(res)
473+
Errno::result(res).map(drop)
474474
}
475475

476476
#[cfg(any(target_os = "linux",

0 commit comments

Comments
 (0)