diff options
author | Homu <homu@barosl.com> | 2017-02-28 21:55:42 +0900 |
---|---|---|
committer | Homu <homu@barosl.com> | 2017-02-28 21:55:42 +0900 |
commit | 70a1bd4a80edb729a251e63dd8077c253a966638 (patch) | |
tree | 4722446507afef3a2fb283d16db1ec6c31a4c493 | |
parent | c47f664f891ab569bac9bc470c21b77aaeb91604 (diff) | |
parent | 33f8f3c12f4baf36d53b4a3e0efd99ee85c00125 (diff) | |
download | nix-70a1bd4a80edb729a251e63dd8077c253a966638.zip |
Auto merge of #541 - kamalmarhubi:export-fcntl-args, r=fiveop
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`.
-rw-r--r-- | CHANGELOG.md | 3 | ||||
-rw-r--r-- | src/fcntl.rs | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index c46e94f5..aa12f127 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/src/fcntl.rs b/src/fcntl.rs index 64e9fb60..e224d3b1 100644 --- a/src/fcntl.rs +++ b/src/fcntl.rs @@ -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), |