diff --git a/Cargo.toml b/Cargo.toml index 93ac9659c..8d5eb4186 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,6 +6,7 @@ build = "build.rs" [features] unix = [ + "chmod", "chroot", "du", "groups", @@ -31,7 +32,6 @@ generic = [ "base64", "basename", "cat", - "chmod", "cksum", "comm", "cp", diff --git a/Makefile b/Makefile index 68979e6b2..6ba08aa04 100644 --- a/Makefile +++ b/Makefile @@ -28,7 +28,6 @@ PROGS := \ base64 \ basename \ cat \ - chmod \ cksum \ comm \ cp \ @@ -81,6 +80,7 @@ PROGS := \ whoami UNIX_PROGS := \ + chmod \ chroot \ du \ groups \ diff --git a/src/mv/Cargo.toml b/src/mv/Cargo.toml index 82dfa90e0..c05846062 100644 --- a/src/mv/Cargo.toml +++ b/src/mv/Cargo.toml @@ -14,6 +14,7 @@ uucore = { path="../uucore" } [dev-dependencies] time = "*" + [[bin]] name="mv" path="mv.rs" diff --git a/src/sync/Cargo.toml b/src/sync/Cargo.toml index 9d2cacb46..5ad082c47 100644 --- a/src/sync/Cargo.toml +++ b/src/sync/Cargo.toml @@ -10,6 +10,8 @@ path = "sync.rs" [dependencies] getopts = "*" libc = "*" +winapi = "*" +kernel32-sys = "*" uucore = { path="../uucore" } [[bin]] diff --git a/src/uucore/Cargo.toml b/src/uucore/Cargo.toml index 65c4d6a01..43866d864 100644 --- a/src/uucore/Cargo.toml +++ b/src/uucore/Cargo.toml @@ -6,6 +6,7 @@ authors = [] [dependencies] libc = "*" time = "*" +winapi = "*" [lib] path = "lib.rs" diff --git a/src/uucore/fs.rs b/src/uucore/fs.rs index 461c70940..f875f679b 100644 --- a/src/uucore/fs.rs +++ b/src/uucore/fs.rs @@ -12,7 +12,8 @@ // be backported to stable (<= 1.1). This will likely be dropped // when the path trait stabilizes. -use ::libc; +#[cfg(unix)] +use super::libc; use std::env; use std::fs; use std::io::{Error, ErrorKind, Result}; @@ -151,7 +152,7 @@ pub fn is_stdin_interactive() -> bool { #[cfg(windows)] pub fn is_stdin_interactive() -> bool { - 0 + false } #[cfg(unix)] @@ -161,7 +162,7 @@ pub fn is_stdout_interactive() -> bool { #[cfg(windows)] pub fn is_stdout_interactive() -> bool { - 0 + false } #[cfg(unix)] @@ -171,5 +172,5 @@ pub fn is_stderr_interactive() -> bool { #[cfg(windows)] pub fn is_stderr_interactive() -> bool { - 0 + false } diff --git a/src/uucore/lib.rs b/src/uucore/lib.rs index 17fd1071f..f5788e8d6 100644 --- a/src/uucore/lib.rs +++ b/src/uucore/lib.rs @@ -1,5 +1,6 @@ extern crate libc; extern crate time; +#[cfg(windows)] extern crate winapi; #[macro_use] mod macros; diff --git a/src/whoami/Cargo.toml b/src/whoami/Cargo.toml index 13598a92a..2e4768ea6 100644 --- a/src/whoami/Cargo.toml +++ b/src/whoami/Cargo.toml @@ -10,6 +10,8 @@ path = "whoami.rs" [dependencies] getopts = "*" libc = "*" +winapi = "*" +advapi32-sys = "*" uucore = { path="../uucore" } [[bin]] diff --git a/src/whoami/platform/windows.rs b/src/whoami/platform/windows.rs index eda1753bb..f2d627431 100644 --- a/src/whoami/platform/windows.rs +++ b/src/whoami/platform/windows.rs @@ -11,8 +11,7 @@ extern crate winapi; extern crate advapi32; extern crate uucore; -use std::ffi::OsString; -use std::io::{Error, Result, Write}; +use std::io::{Error, Result}; use std::mem; use std::os::windows::ffi::OsStringExt; use uucore::wide::FromWide;