소스 검색

Return correct error code from access

Jeremy Soller 6 년 전
부모
커밋
05f17794e4
1개의 변경된 파일2개의 추가작업 그리고 4개의 파일을 삭제
  1. 2 4
      src/platform/redox/mod.rs

+ 2 - 4
src/platform/redox/mod.rs

@@ -59,11 +59,9 @@ impl Pal for Sys {
     fn access(path: &CStr, mode: c_int) -> c_int {
         let fd = match File::open(path, fcntl::O_PATH | fcntl::O_CLOEXEC) {
             Ok(fd) => fd,
-            Err(_) => unsafe {
-                errno = EIO;
-                return -1;
-            },
+            Err(_) => return -1,
         };
+
         if mode == F_OK {
             return 0;
         }