Skip to content

Commit

Permalink
Fix fallocate return type
Browse files Browse the repository at this point in the history
Untested, done on github.

Fixes #1200
  • Loading branch information
DianaNites committed Mar 28, 2020
1 parent 5c3fbbb commit 9064823
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -17,6 +17,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
- Derived `Ord`, `PartialOrd` for `unistd::Pid` (#[1189](https://github.com/nix-rust/nix/pull/1189))

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

Expand Down
4 changes: 2 additions & 2 deletions src/fcntl.rs
Expand Up @@ -468,9 +468,9 @@ libc_bitflags!(
/// Allows the caller to directly manipulate the allocated disk space for the
/// file referred to by fd.
#[cfg(any(target_os = "linux"))]
pub fn fallocate(fd: RawFd, mode: FallocateFlags, offset: libc::off_t, len: libc::off_t) -> Result<c_int> {
pub fn fallocate(fd: RawFd, mode: FallocateFlags, offset: libc::off_t, len: libc::off_t) -> Result<()> {
let res = unsafe { libc::fallocate(fd, mode.bits(), offset, len) };
Errno::result(res)
Errno::result(res).map(drop)
}

#[cfg(any(target_os = "linux",
Expand Down

0 comments on commit 9064823

Please sign in to comment.