Skip to content

Commit 76ff507

Browse files
author
Al Hoang
committed
haiku: attempt to address builder issues
1 parent feede47 commit 76ff507

File tree

3 files changed

+22
-13
lines changed

3 files changed

+22
-13
lines changed

test/test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#[macro_use]
22
extern crate cfg_if;
3-
#[cfg_attr(not(target_os = "redox"), macro_use)]
3+
#[cfg_attr(not(any(target_os = "redox", target_os = "haiku")), macro_use)]
44
extern crate nix;
55
#[macro_use]
66
extern crate lazy_static;

test/test_stat.rs

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
#[cfg(not(target_os = "redox"))]
1+
#[cfg(not(any(target_os = "redox", target_os = "haiku")))]
22
use std::fs;
33
use std::fs::File;
44
#[cfg(not(target_os = "redox"))]
5-
use std::os::unix::fs::{symlink, PermissionsExt};
5+
use std::os::unix::fs::{symlink};
6+
#[cfg(not(any(target_os = "redox", target_os = "haiku")))]
7+
use std::os::unix::fs::{PermissionsExt};
68
use std::os::unix::prelude::AsRawFd;
7-
#[cfg(not(target_os = "redox"))]
9+
#[cfg(not(any(target_os = "redox", target_os = "haiku")))]
810
use std::time::{Duration, UNIX_EPOCH};
911
#[cfg(not(target_os = "redox"))]
1012
use std::path::Path;
@@ -18,25 +20,30 @@ use nix::fcntl;
1820
#[cfg(not(target_os = "redox"))]
1921
use nix::errno::Errno;
2022
#[cfg(not(target_os = "redox"))]
21-
use nix::sys::stat::{self, futimens, utimes};
23+
use nix::sys::stat::{self};
24+
#[cfg(not(any(target_os = "redox", target_os = "haiku")))]
25+
use nix::sys::stat::{futimens, utimes};
2226
use nix::sys::stat::{fchmod, stat};
2327
#[cfg(not(target_os = "redox"))]
24-
use nix::sys::stat::{fchmodat, utimensat, mkdirat};
28+
use nix::sys::stat::{fchmodat, mkdirat};
29+
#[cfg(not(any(target_os = "redox", target_os = "haiku")))]
30+
use nix::sys::stat::{utimensat};
2531
#[cfg(any(target_os = "linux",
26-
target_os = "haiku",
2732
target_os = "ios",
2833
target_os = "macos",
2934
target_os = "freebsd",
3035
target_os = "netbsd"))]
3136
use nix::sys::stat::lutimes;
3237
#[cfg(not(target_os = "redox"))]
38+
use nix::sys::stat::{FchmodatFlags};
39+
#[cfg(not(any(target_os = "redox", target_os = "haiku")))]
3340
use nix::sys::stat::{FchmodatFlags, UtimensatFlags};
3441
use nix::sys::stat::Mode;
3542

3643
#[cfg(not(any(target_os = "netbsd", target_os = "redox")))]
3744
use nix::sys::stat::FileStat;
3845

39-
#[cfg(not(target_os = "redox"))]
46+
#[cfg(not(any(target_os = "redox", target_os = "haiku")))]
4047
use nix::sys::time::{TimeSpec, TimeVal, TimeValLike};
4148
#[cfg(not(target_os = "redox"))]
4249
use nix::unistd::chdir;
@@ -191,7 +198,7 @@ fn test_fchmodat() {
191198
///
192199
/// The atime and mtime are expressed with a resolution of seconds because some file systems
193200
/// (like macOS's HFS+) do not have higher granularity.
194-
#[cfg(not(target_os = "redox"))]
201+
#[cfg(not(any(target_os = "redox", target_os = "haiku")))]
195202
fn assert_times_eq(exp_atime_sec: u64, exp_mtime_sec: u64, attr: &fs::Metadata) {
196203
assert_eq!(
197204
Duration::new(exp_atime_sec, 0),

test/test_unistd.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
#[cfg(not(target_os = "redox"))]
2-
use nix::fcntl::{self, open, readlink};
2+
use nix::fcntl::{self, open};
3+
#[cfg(not(any(target_os = "redox", target_os = "haiku")))]
4+
use nix::fcntl::{readlink};
35
use nix::fcntl::OFlag;
46
use nix::unistd::*;
57
use nix::unistd::ForkResult::*;
68
#[cfg(not(target_os = "redox"))]
79
use nix::sys::signal::{SaFlags, SigAction, SigHandler, SigSet, Signal, sigaction};
810
use nix::sys::wait::*;
911
use nix::sys::stat::{self, Mode, SFlag};
10-
#[cfg(not(any(target_os = "redox", target_os = "fuchsia")))]
12+
#[cfg(not(any(target_os = "redox", target_os = "fuchsia", target_os = "haiku")))]
1113
use nix::pty::{posix_openpt, grantpt, unlockpt, ptsname};
1214
use nix::errno::Errno;
1315
use std::env;
@@ -18,7 +20,7 @@ use std::fs::DirBuilder;
1820
use std::fs::{self, File};
1921
use std::io::Write;
2022
use std::os::unix::prelude::*;
21-
#[cfg(not(any(target_os = "fuchsia", target_os = "redox")))]
23+
#[cfg(not(any(target_os = "fuchsia", target_os = "redox", target_os = "haiku")))]
2224
use std::path::Path;
2325
use tempfile::{tempdir, tempfile};
2426
use libc::{_exit, mode_t, off_t};
@@ -556,7 +558,7 @@ cfg_if!{
556558
skip_if_jailed!("test_acct");
557559
}
558560
}
559-
} else if #[cfg(not(any(target_os = "redox", target_os = "fuchsia")))] {
561+
} else if #[cfg(not(any(target_os = "redox", target_os = "fuchsia", target_os = "haiku")))] {
560562
macro_rules! require_acct{
561563
() => {
562564
skip_if_not_root!("test_acct");

0 commit comments

Comments
 (0)