From e8aa7241fab8d548ab6bdac53aae79b2d2fbd6f0 Mon Sep 17 00:00:00 2001 From: Joseph Crail Date: Tue, 1 Dec 2015 01:27:08 -0500 Subject: [PATCH 1/3] Fix errors with bools represented as ints. --- src/uucore/fs.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/uucore/fs.rs b/src/uucore/fs.rs index 461c70940..660086202 100644 --- a/src/uucore/fs.rs +++ b/src/uucore/fs.rs @@ -151,7 +151,7 @@ pub fn is_stdin_interactive() -> bool { #[cfg(windows)] pub fn is_stdin_interactive() -> bool { - 0 + false } #[cfg(unix)] @@ -161,7 +161,7 @@ pub fn is_stdout_interactive() -> bool { #[cfg(windows)] pub fn is_stdout_interactive() -> bool { - 0 + false } #[cfg(unix)] @@ -171,5 +171,5 @@ pub fn is_stderr_interactive() -> bool { #[cfg(windows)] pub fn is_stderr_interactive() -> bool { - 0 + false } From cbce549de78951a9a7d9b1e9b32a9bf759a79c2a Mon Sep 17 00:00:00 2001 From: Joseph Crail Date: Tue, 1 Dec 2015 01:27:20 -0500 Subject: [PATCH 2/3] More import fixes for Windows. --- src/mv/Cargo.toml | 1 + src/sync/Cargo.toml | 2 ++ src/uucore/Cargo.toml | 1 + src/uucore/fs.rs | 3 ++- src/uucore/lib.rs | 1 + src/whoami/Cargo.toml | 2 ++ src/whoami/platform/windows.rs | 3 +-- 7 files changed, 10 insertions(+), 3 deletions(-) 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 660086202..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}; 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; From 2c8ebb621546971d3d5978f339328f2dc633d034 Mon Sep 17 00:00:00 2001 From: Joseph Crail Date: Tue, 1 Dec 2015 01:27:36 -0500 Subject: [PATCH 3/3] Mark chmod as Unix-only until better Win support. --- Cargo.toml | 2 +- Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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 \