Просмотр исходного кода

Merge pull request #89 from jbeich/freebsd

Minor fixes for FreeBSD
Benjamin Sago 10 лет назад
Родитель
Сommit
f2143d948c
3 измененных файлов с 11 добавлено и 5 удалено
  1. 2 1
      src/feature/xattr.rs
  2. 2 3
      src/options.rs
  3. 7 1
      src/term.rs

+ 2 - 1
src/feature/xattr.rs

@@ -3,7 +3,6 @@ extern crate libc;
 
 
 use std::io;
 use std::io;
 use std::path::Path;
 use std::path::Path;
-use std::ffi::CString;
 
 
 pub const ENABLED: bool = cfg!(feature="git") && cfg!(any(target_os="macos", target_os="linux"));
 pub const ENABLED: bool = cfg!(feature="git") && cfg!(any(target_os="macos", target_os="linux"));
 
 
@@ -51,6 +50,8 @@ pub struct Attribute {
 
 
 #[cfg(any(target_os = "macos", target_os = "linux"))]
 #[cfg(any(target_os = "macos", target_os = "linux"))]
 pub fn list_attrs(lister: lister::Lister, path: &Path) -> io::Result<Vec<Attribute>> {
 pub fn list_attrs(lister: lister::Lister, path: &Path) -> io::Result<Vec<Attribute>> {
+    use std::ffi::CString;
+
     let c_path = match path.to_str().and_then(|s| { CString::new(s).ok() }) {
     let c_path = match path.to_str().and_then(|s| { CString::new(s).ok() }) {
         Some(cstring) => cstring,
         Some(cstring) => cstring,
         None => return Err(io::Error::new(io::ErrorKind::Other, "Error: path somehow contained a NUL?")),
         None => return Err(io::Error::new(io::ErrorKind::Other, "Error: path somehow contained a NUL?")),

+ 2 - 3
src/options.rs

@@ -727,9 +727,8 @@ LONG VIEW OPTIONS
   -U, --created      display timestamp of creation for a file
   -U, --created      display timestamp of creation for a file
 "##;
 "##;
 
 
-static GIT_HELP:      &'static str = r##"  -@, --extended     display extended attribute keys and sizes"##;
-static EXTENDED_HELP: &'static str = r##"  --git              show git status for files"##;
-
+static GIT_HELP:      &'static str = r##"  --git              show git status for files"##;
+static EXTENDED_HELP: &'static str = r##"  -@, --extended     display extended attribute keys and sizes"##;
 
 
 #[cfg(test)]
 #[cfg(test)]
 mod test {
 mod test {

+ 7 - 1
src/term.rs

@@ -22,7 +22,13 @@ struct Winsize {
 #[cfg(any(target_os = "linux", target_os = "android"))]
 #[cfg(any(target_os = "linux", target_os = "android"))]
 static TIOCGWINSZ: c_ulong = 0x5413;
 static TIOCGWINSZ: c_ulong = 0x5413;
 
 
-#[cfg(any(target_os = "macos", target_os = "ios", target_os = "dragonfly"))]
+#[cfg(any(target_os = "macos",
+          target_os = "ios",
+          target_os = "bitrig",
+          target_os = "dragonfly",
+          target_os = "freebsd",
+          target_os = "netbsd",
+          target_os = "openbsd"))]
 static TIOCGWINSZ: c_ulong = 0x40087468;
 static TIOCGWINSZ: c_ulong = 0x40087468;
 
 
 extern {
 extern {