mirror of
https://github.com/odin-lang/Odin.git
synced 2026-04-06 06:38:20 +00:00
Merge pull request #6364 from IllusionMan1212/eacces-perm-denied
os: return `.Permission_Denied` for `.EACCES` in posix and linux
This commit is contained in:
@@ -148,7 +148,7 @@ _get_platform_error :: proc(errno: linux.Errno) -> Error {
|
||||
#partial switch errno {
|
||||
case .NONE:
|
||||
return nil
|
||||
case .EPERM:
|
||||
case .EPERM, .EACCES:
|
||||
return .Permission_Denied
|
||||
case .EEXIST:
|
||||
return .Exist
|
||||
|
||||
@@ -16,7 +16,7 @@ _get_platform_error_from_errno :: proc() -> Error {
|
||||
|
||||
_get_platform_error_existing :: proc(errno: posix.Errno) -> Error {
|
||||
#partial switch errno {
|
||||
case .EPERM:
|
||||
case .EPERM, .EACCES:
|
||||
return .Permission_Denied
|
||||
case .EEXIST:
|
||||
return .Exist
|
||||
|
||||
Reference in New Issue
Block a user