Skip to content

Commit 26d6969

Browse files
committed
---
yaml --- r: 172719 b: refs/heads/try c: ac0607a h: refs/heads/master i: 172717: 5345d82 172715: da50add 172711: c88165c 172703: 391f133 v: v3
1 parent 6bf21b2 commit 26d6969

File tree

2 files changed

+22
-9
lines changed

2 files changed

+22
-9
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 170c4399e614fe599c3d41306b3429ca8b3b68c6
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 5b3cd3900ceda838f5798c30ab96ceb41f962534
5-
refs/heads/try: 1fb91dc1c2a34e5cbe384493616254253c821e41
5+
refs/heads/try: ac0607acb27ed8ad3852a6e099ff0766b002f40e
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
88
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596

branches/try/src/libstd/io/test.rs

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,23 +23,36 @@ pub fn next_test_port() -> u16 {
2323
base_port() + NEXT_OFFSET.fetch_add(1, Ordering::Relaxed) as u16
2424
}
2525

26-
/// Get a temporary path which could be the location of a unix socket
27-
pub fn next_test_unix() -> Path {
26+
// iOS has a pretty long tmpdir path which causes pipe creation
27+
// to like: invalid argument: path must be smaller than SUN_LEN
28+
fn next_test_unix_socket() -> String {
2829
static COUNT: AtomicUint = ATOMIC_UINT_INIT;
2930
// base port and pid are an attempt to be unique between multiple
3031
// test-runners of different configurations running on one
3132
// buildbot, the count is to be unique within this executable.
32-
let string = format!("rust-test-unix-path-{}-{}-{}",
33-
base_port(),
34-
unsafe {libc::getpid()},
35-
COUNT.fetch_add(1, Ordering::Relaxed));
33+
format!("rust-test-unix-path-{}-{}-{}",
34+
base_port(),
35+
unsafe {libc::getpid()},
36+
COUNT.fetch_add(1, Ordering::Relaxed))
37+
}
38+
39+
/// Get a temporary path which could be the location of a unix socket
40+
#[cfg(not(target_os = "ios"))]
41+
pub fn next_test_unix() -> Path {
42+
let string = next_test_unix_socket();
3643
if cfg!(unix) {
3744
os::tmpdir().join(string)
3845
} else {
3946
Path::new(format!("{}{}", r"\\.\pipe\", string))
4047
}
4148
}
4249

50+
/// Get a temporary path which could be the location of a unix socket
51+
#[cfg(target_os = "ios")]
52+
pub fn next_test_unix() -> Path {
53+
Path::new(format!("/var/tmp/{}", next_test_unix_socket()))
54+
}
55+
4356
/// Get a unique IPv4 localhost:port pair starting at 9600
4457
pub fn next_test_ip4() -> SocketAddr {
4558
SocketAddr { ip: Ipv4Addr(127, 0, 0, 1), port: next_test_port() }
@@ -99,7 +112,7 @@ pub fn raise_fd_limit() {
99112
/// multithreaded scheduler testing, depending on the number of cores available.
100113
///
101114
/// This fixes issue #7772.
102-
#[cfg(target_os="macos")]
115+
#[cfg(any(target_os = "macos", target_os = "ios"))]
103116
#[allow(non_camel_case_types)]
104117
mod darwin_fd_limit {
105118
use libc;
@@ -156,7 +169,7 @@ mod darwin_fd_limit {
156169
}
157170
}
158171

159-
#[cfg(not(target_os="macos"))]
172+
#[cfg(not(any(target_os = "macos", target_os = "ios")))]
160173
mod darwin_fd_limit {
161174
pub unsafe fn raise_fd_limit() {}
162175
}

0 commit comments

Comments
 (0)