Skip to content

Commit 1ec0d10

Browse files
committed
---
yaml --- r: 193147 b: refs/heads/beta c: d54ed56 h: refs/heads/master i: 193145: 15325ef 193143: 5f28886 v: v3
1 parent a50dab1 commit 1ec0d10

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
@@ -31,7 +31,7 @@ refs/heads/automation-fail: 1bf06495443584539b958873e04cc2f864ab10e4
3131
refs/heads/issue-18208-method-dispatch-3-quick-reject: 2009f85b9f99dedcec4404418eda9ddba90258a2
3232
refs/heads/batch: b7fd822592a4fb577552d93010c4a4e14f314346
3333
refs/heads/building: 126db549b038c84269a1e4fe46f051b2c15d6970
34-
refs/heads/beta: 2470fa155e8a0793d725891da2e6963c762fa674
34+
refs/heads/beta: d54ed567e0714f6fac91b2f7f204a48a059b0f9f
3535
refs/heads/windistfix: 7608dbad651f02e837ed05eef3d74a6662a6e928
3636
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
3737
refs/heads/tmp: de8a23bbc3a7b9cbd7574b5b91a34af59bf030e6

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