From 7a3ba3242a179304fb8a4add99504e91967816f4 Mon Sep 17 00:00:00 2001 From: Steve Smith Date: Sun, 5 Jun 2016 11:45:44 +0100 Subject: [PATCH] Need to make the `use` Linux-only too. --- src/ls/ls.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/ls/ls.rs b/src/ls/ls.rs index cebc60156..a6fef41a6 100644 --- a/src/ls/ls.rs +++ b/src/ls/ls.rs @@ -26,8 +26,6 @@ use std::ffi::{OsString,CStr}; use std::path::Path; use std::io::Write; use std::ptr; -use uucore::c_types::{getpwuid, getgrgid}; - #[derive(Copy, Clone, PartialEq)] enum Mode { @@ -166,6 +164,9 @@ fn cstr2string(cstr: *const c_char) -> String { // Currently getpwuid is `linux` target only. If it's broken out into // a posix-compliant attribute this can be updated... +#[cfg(target_family = "linux")] +use uucore::c_types::{getpwuid, getgrgid}; + #[cfg(target_family = "linux")] fn display_uname(metadata: &Metadata) -> String { use std::os::unix::fs::MetadataExt;