| ... | ... | @@ -285,27 +285,27 @@ pub fn posixOpenC(file_path: &const u8, flags: u32, perm: usize) !i32 { |
| 285 | 285 | const result = posix.open(file_path, flags, perm); |
| 286 | 286 | const err = posix.getErrno(result); |
| 287 | 287 | if (err > 0) { |
| 288 | | return switch (err) { |
| 288 | switch (err) { |
| 289 | 289 | posix.EINTR => continue, |
| 290 | 290 | |
| 291 | 291 | posix.EFAULT => unreachable, |
| 292 | 292 | posix.EINVAL => unreachable, |
| 293 | | posix.EACCES => PosixOpenError.AccessDenied, |
| 294 | | posix.EFBIG, posix.EOVERFLOW => PosixOpenError.FileTooBig, |
| 295 | | posix.EISDIR => PosixOpenError.IsDir, |
| 296 | | posix.ELOOP => PosixOpenError.SymLinkLoop, |
| 297 | | posix.EMFILE => PosixOpenError.ProcessFdQuotaExceeded, |
| 298 | | posix.ENAMETOOLONG => PosixOpenError.NameTooLong, |
| 299 | | posix.ENFILE => PosixOpenError.SystemFdQuotaExceeded, |
| 300 | | posix.ENODEV => PosixOpenError.NoDevice, |
| 301 | | posix.ENOENT => PosixOpenError.PathNotFound, |
| 302 | | posix.ENOMEM => PosixOpenError.SystemResources, |
| 303 | | posix.ENOSPC => PosixOpenError.NoSpaceLeft, |
| 304 | | posix.ENOTDIR => PosixOpenError.NotDir, |
| 305 | | posix.EPERM => PosixOpenError.AccessDenied, |
| 306 | | posix.EEXIST => PosixOpenError.PathAlreadyExists, |
| 307 | | else => unexpectedErrorPosix(err), |
| 308 | | }; |
| 293 | posix.EACCES => return PosixOpenError.AccessDenied, |
| 294 | posix.EFBIG, posix.EOVERFLOW => return PosixOpenError.FileTooBig, |
| 295 | posix.EISDIR => return PosixOpenError.IsDir, |
| 296 | posix.ELOOP => return PosixOpenError.SymLinkLoop, |
| 297 | posix.EMFILE => return PosixOpenError.ProcessFdQuotaExceeded, |
| 298 | posix.ENAMETOOLONG => return PosixOpenError.NameTooLong, |
| 299 | posix.ENFILE => return PosixOpenError.SystemFdQuotaExceeded, |
| 300 | posix.ENODEV => return PosixOpenError.NoDevice, |
| 301 | posix.ENOENT => return PosixOpenError.PathNotFound, |
| 302 | posix.ENOMEM => return PosixOpenError.SystemResources, |
| 303 | posix.ENOSPC => return PosixOpenError.NoSpaceLeft, |
| 304 | posix.ENOTDIR => return PosixOpenError.NotDir, |
| 305 | posix.EPERM => return PosixOpenError.AccessDenied, |
| 306 | posix.EEXIST => return PosixOpenError.PathAlreadyExists, |
| 307 | else => return unexpectedErrorPosix(err), |
| 308 | } |
| 309 | 309 | } |
| 310 | 310 | return i32(result); |
| 311 | 311 | } |