From 49b7a5f427aaa08c217d784ec4b643d285cce5a8 Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Sun, 19 Aug 2018 12:33:51 -0600 Subject: [PATCH] Fix types when compiling for Redox --- Xargo.toml | 6 ++++++ src/config/file.rs | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 Xargo.toml diff --git a/Xargo.toml b/Xargo.toml new file mode 100644 index 0000000000..0c493ec3d6 --- /dev/null +++ b/Xargo.toml @@ -0,0 +1,6 @@ +[dependencies.std] +features = ["panic_unwind", "backtrace"] + +#[dependencies.test] +#stage = 1 + diff --git a/src/config/file.rs b/src/config/file.rs index 466027df22..e6e693feb4 100644 --- a/src/config/file.rs +++ b/src/config/file.rs @@ -1,6 +1,6 @@ use Result; -use libc::chown; +use libc::{chown, gid_t, uid_t}; use std::io::{Error, Write}; use std::ffi::{CString, OsStr}; @@ -71,7 +71,7 @@ impl FileConfig { // chown let c_path = CString::new(path.as_os_str().as_bytes()).unwrap(); let ret = unsafe { - chown(c_path.as_ptr(), uid, gid) + chown(c_path.as_ptr(), uid as uid_t, gid as gid_t) }; // credit to uutils if ret == 0 {