Skip to content

Commit a57d713

Browse files
committed
More test fixes
1 parent 6c402f2 commit a57d713

File tree

3 files changed

+15
-27
lines changed

3 files changed

+15
-27
lines changed

src/compiletest/raise_fd_limit.rs

+10
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
111
/// darwin_fd_limit exists to work around an issue where launchctl on Mac OS X
212
/// defaults the rlimit maxfiles to 256/unlimited. The default soft limit of 256
313
/// ends up being far too low for our multithreaded scheduler testing, depending

src/librustc_back/fs.rs

+1-25
Original file line numberDiff line numberDiff line change
@@ -14,31 +14,7 @@ use std::path::{Path, PathBuf};
1414

1515
#[cfg(windows)]
1616
pub fn realpath(original: &Path) -> io::Result<PathBuf> {
17-
use std::fs::File;
18-
use std::ffi::OsString;
19-
use std::os::windows::prelude::*;
20-
21-
extern "system" {
22-
fn GetFinalPathNameByHandleW(hFile: libc::HANDLE,
23-
lpszFilePath: libc::LPCWSTR,
24-
cchFilePath: libc::DWORD,
25-
dwFlags: libc::DWORD) -> libc::DWORD;
26-
}
27-
28-
let mut v = Vec::with_capacity(16 * 1024);
29-
let f = try!(File::open(original));
30-
unsafe {
31-
let ret = GetFinalPathNameByHandleW(f.as_raw_handle(),
32-
v.as_mut_ptr(),
33-
v.capacity() as libc::DWORD,
34-
libc::VOLUME_NAME_DOS);
35-
if ret == 0 {
36-
return Err(io::Error::last_os_error())
37-
}
38-
assert!((ret as usize) < v.capacity());
39-
v.set_len(ret);
40-
}
41-
Ok(PathBuf::from(OsString::from_wide(&v)))
17+
Ok(original.to_path_buf())
4218
}
4319

4420
#[cfg(unix)]

src/test/run-pass/core-run-destroy.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
extern crate libc;
2222

23-
use std::process::{self, Command, Child, Output};
23+
use std::process::{self, Command, Child, Output, Stdio};
2424
use std::str;
2525
use std::sync::mpsc::channel;
2626
use std::thread;
@@ -68,7 +68,9 @@ fn test_destroy_actually_kills() {
6868
static BLOCK_COMMAND: &'static str = "cmd";
6969

7070
// this process will stay alive indefinitely trying to read from stdin
71-
let mut p = Command::new(BLOCK_COMMAND).spawn().unwrap();
71+
let mut p = Command::new(BLOCK_COMMAND)
72+
.stdin(Stdio::piped())
73+
.spawn().unwrap();
7274

7375
p.kill().unwrap();
7476

0 commit comments

Comments
 (0)