mirror of
https://github.com/Ed94/Odin.git
synced 2026-07-28 18:30:06 +00:00
Try to map to General_Error where possible
This commit is contained in:
+12
-1
@@ -521,7 +521,18 @@ _get_errno :: proc(res: int) -> Errno {
|
||||
|
||||
// get errno from libc
|
||||
get_last_error :: proc "contextless" () -> Error {
|
||||
return Platform_Error(__errno_location()^)
|
||||
err := Platform_Error(__errno_location()^)
|
||||
#partial switch err {
|
||||
case .NONE:
|
||||
return nil
|
||||
case .EPERM:
|
||||
return .Permission_Denied
|
||||
case .EEXIST:
|
||||
return .Exist
|
||||
case .ENOENT:
|
||||
return .Not_Exist
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
personality :: proc(persona: u64) -> (Errno) {
|
||||
|
||||
Reference in New Issue
Block a user