From ea6ed5a097e032fabc94a03916b73c26b0d9f637 Mon Sep 17 00:00:00 2001 From: Julio Merino Date: Tue, 16 Oct 2018 21:28:33 -0400 Subject: [PATCH] Make sys::stat::mode_t public This allows using e.g. sys::stat::Mode::from_bits() without having to pull the mode_t type from libc (which is ugly if a project is trying to use nix exclusively to avoid libc's unsafety). This change mimics dev_t which was already exposed as public. --- CHANGELOG.md | 2 ++ src/sys/stat.rs | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dd43c9a9cc..e1e0c01d3e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,8 @@ This project adheres to [Semantic Versioning](http://semver.org/). - Added `futimens` and `utimesat` wrappers ([#944](https://github.com/nix-rust/nix/pull/944)) and a `utimes` wrapper ([#946](https://github.com/nix-rust/nix/pull/946)). - Added `AF_UNSPEC` wrapper to `AddressFamily` ([#948](https://github.com/nix-rust/nix/pull/948)) +- Added the `mode_t` public alias within `sys::stat`. + ([#954](https://github.com/nix-rust/nix/pull/954)) ### Changed - Increased required Rust version to 1.22.1/ diff --git a/src/sys/stat.rs b/src/sys/stat.rs index b810c16731..d0f0f8d9d8 100644 --- a/src/sys/stat.rs +++ b/src/sys/stat.rs @@ -1,10 +1,10 @@ -pub use libc::dev_t; +pub use libc::{dev_t, mode_t}; pub use libc::stat as FileStat; use {Result, NixPath}; use errno::Errno; use fcntl::AtFlags; -use libc::{self, mode_t}; +use libc; use std::mem; use std::os::raw; use std::os::unix::io::RawFd;