Skip to content

Commit

Permalink
Auto merge of #541 - kamalmarhubi:export-fcntl-args, r=fiveop
Browse files Browse the repository at this point in the history
fcntl: Expose FcntlArg variants at the module level

This allows importing them directly from `nix::fcntl` which is more
ergonomic than needing to use them via `FcntlArg`.
  • Loading branch information
homu committed Feb 28, 2017
2 parents c47f664 + 33f8f3c commit 70a1bd4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ This project adheres to [Semantic Versioning](http://semver.org/).
return a `&CStr` within the provided buffer that is always properly
NUL-terminated (this is not guaranteed by the call with all platforms/libc
implementations).
- Exposed all fcntl(2) operations at the module level, so they can be
imported direclty instead of via `FcntlArg` enum.
([#541](https://github.com/nix-rust/nix/pull/541))

### Fixed
- Fixed multiple issues with Unix domain sockets on non-Linux OSes
Expand Down
3 changes: 1 addition & 2 deletions src/fcntl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,10 @@ pub enum FcntlArg<'a> {

// TODO: Rest of flags
}
pub use self::FcntlArg::*;

// TODO: Figure out how to handle value fcntl returns
pub fn fcntl(fd: RawFd, arg: FcntlArg) -> Result<c_int> {
use self::FcntlArg::*;

let res = unsafe {
match arg {
F_DUPFD(rawfd) => libc::fcntl(fd, libc::F_DUPFD, rawfd),
Expand Down

0 comments on commit 70a1bd4

Please sign in to comment.