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