Skip to content

Commit 6d1399e

Browse files
committed
---
yaml --- r: 185929 b: refs/heads/auto c: d54ed56 h: refs/heads/master i: 185927: ad6806f v: v3
1 parent f910976 commit 6d1399e

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1010
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1111
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1212
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
13-
refs/heads/auto: 2470fa155e8a0793d725891da2e6963c762fa674
13+
refs/heads/auto: d54ed567e0714f6fac91b2f7f204a48a059b0f9f
1414
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1515
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1616
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/src/libstd/sys/unix/os.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ impl StdError for JoinPathsError {
183183
}
184184

185185
#[cfg(target_os = "freebsd")]
186-
pub fn current_exe() -> IoResult<Path> {
186+
pub fn current_exe() -> io::Result<PathBuf> {
187187
unsafe {
188188
use libc::funcs::bsd44::*;
189189
use libc::consts::os::extra::*;
@@ -195,16 +195,16 @@ pub fn current_exe() -> IoResult<Path> {
195195
let err = sysctl(mib.as_mut_ptr(), mib.len() as ::libc::c_uint,
196196
ptr::null_mut(), &mut sz, ptr::null_mut(),
197197
0 as libc::size_t);
198-
if err != 0 { return Err(IoError::last_error()); }
199-
if sz == 0 { return Err(IoError::last_error()); }
198+
if err != 0 { return Err(io::Error::last_os_error()); }
199+
if sz == 0 { return Err(io::Error::last_os_error()); }
200200
let mut v: Vec<u8> = Vec::with_capacity(sz as uint);
201201
let err = sysctl(mib.as_mut_ptr(), mib.len() as ::libc::c_uint,
202202
v.as_mut_ptr() as *mut libc::c_void, &mut sz,
203203
ptr::null_mut(), 0 as libc::size_t);
204-
if err != 0 { return Err(IoError::last_error()); }
205-
if sz == 0 { return Err(IoError::last_error()); }
204+
if err != 0 { return Err(io::Error::last_os_error()); }
205+
if sz == 0 { return Err(io::Error::last_os_error()); }
206206
v.set_len(sz as uint - 1); // chop off trailing NUL
207-
Ok(Path::new(v))
207+
Ok(PathBuf::new::<OsString>(&OsStringExt::from_vec(v)))
208208
}
209209
}
210210

@@ -227,7 +227,7 @@ pub fn current_exe() -> io::Result<PathBuf> {
227227
unsafe {
228228
let v = rust_current_exe();
229229
if v.is_null() {
230-
Err(IoError::last_error())
230+
Err(io::Error::last_os_error())
231231
} else {
232232
Ok(Path::new(CStr::from_ptr(v).to_bytes().to_vec()))
233233
}
@@ -240,17 +240,17 @@ pub fn current_exe() -> io::Result<PathBuf> {
240240
}
241241

242242
#[cfg(any(target_os = "macos", target_os = "ios"))]
243-
pub fn current_exe() -> IoResult<Path> {
243+
pub fn current_exe() -> io::Result<PathBuf> {
244244
unsafe {
245245
use libc::funcs::extra::_NSGetExecutablePath;
246246
let mut sz: u32 = 0;
247247
_NSGetExecutablePath(ptr::null_mut(), &mut sz);
248-
if sz == 0 { return Err(IoError::last_error()); }
248+
if sz == 0 { return Err(io::Error::last_os_error()); }
249249
let mut v: Vec<u8> = Vec::with_capacity(sz as uint);
250250
let err = _NSGetExecutablePath(v.as_mut_ptr() as *mut i8, &mut sz);
251-
if err != 0 { return Err(IoError::last_error()); }
251+
if err != 0 { return Err(io::Error::last_os_error()); }
252252
v.set_len(sz as uint - 1); // chop off trailing NUL
253-
Ok(Path::new(v))
253+
Ok(PathBuf::new::<OsString>(&OsStringExt::from_vec(v)))
254254
}
255255
}
256256

0 commit comments

Comments
 (0)