Skip to content

Commit c505127

Browse files
committed
---
yaml --- r: 187395 b: refs/heads/try c: d54ed56 h: refs/heads/master i: 187393: a915e0e 187391: 56b3b57 v: v3
1 parent ed83257 commit c505127

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
@@ -2,7 +2,7 @@
22
refs/heads/master: b4c965ee803a4521d8b4575f634e036f93e408f3
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 3a96d6a9818fe2affc98a187fb1065120458cee9
5-
refs/heads/try: 2470fa155e8a0793d725891da2e6963c762fa674
5+
refs/heads/try: d54ed567e0714f6fac91b2f7f204a48a059b0f9f
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
88
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596

branches/try/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)