Skip to content

Commit

Permalink
Merge #1201
Browse files Browse the repository at this point in the history
1201: Fix fallocate signature r=asomers a=DianaNites

Fixes #1200 

Co-authored-by: Diana <5275194+DianaNites@users.noreply.github.com>
  • Loading branch information
bors[bot] and DianaNites committed Mar 28, 2020
2 parents 5c3fbbb + 9064823 commit b5a129a
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 b5a129a

Please sign in to comment.