Fix Redox fchdir

This commit is contained in:
Jeremy Soller
2019-07-06 19:25:05 -06:00
parent 27d97f6fe0
commit 06bab2aa81
+4 -3
View File
@@ -283,11 +283,12 @@ impl Pal for Sys {
}
fn fchdir(fd: c_int) -> c_int {
let path: &mut [u8] = &mut [0; 4096];
if e(syscall::fpath(fd as usize, path)) == !0 {
let mut buf = [0; 4096];
let res = e(syscall::fpath(fd as usize, &mut buf));
if res == !0 {
!0
} else {
e(syscall::chdir(path)) as c_int
e(syscall::chdir(&buf[..res])) as c_int
}
}