mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 07:38:48 +00:00
Errno -> Error
This commit is contained in:
@@ -4,7 +4,7 @@ package os2
|
||||
import "core:sys/linux"
|
||||
|
||||
@(rodata)
|
||||
_errno_strings : [linux.Errno]string = {
|
||||
_errno_strings : [linux.Error]string = {
|
||||
.NONE = "Success",
|
||||
.EPERM = "Operation not permitted",
|
||||
.ENOENT = "No such file or directory",
|
||||
@@ -142,7 +142,7 @@ _errno_strings : [linux.Errno]string = {
|
||||
}
|
||||
|
||||
|
||||
_get_platform_error :: proc(errno: linux.Errno) -> Error {
|
||||
_get_platform_error :: proc(errno: linux.Error) -> Error {
|
||||
#partial switch errno {
|
||||
case .NONE:
|
||||
return nil
|
||||
@@ -158,8 +158,8 @@ _get_platform_error :: proc(errno: linux.Errno) -> Error {
|
||||
}
|
||||
|
||||
_error_string :: proc(errno: i32) -> string {
|
||||
if errno >= 0 && errno <= i32(max(linux.Errno)) {
|
||||
return _errno_strings[linux.Errno(errno)]
|
||||
if errno >= 0 && errno <= i32(max(linux.Error)) {
|
||||
return _errno_strings[linux.Error(errno)]
|
||||
}
|
||||
return "Unknown Error"
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ _mkdir_all :: proc(path: string, perm: int) -> Error {
|
||||
path_bytes[len(path)] = 0
|
||||
|
||||
dfd: linux.Fd
|
||||
errno: linux.Errno
|
||||
errno: linux.Error
|
||||
if path_bytes[0] == '/' {
|
||||
dfd, errno = linux.open("/", _OPENDIR_FLAGS)
|
||||
path_bytes = path_bytes[1:]
|
||||
|
||||
Reference in New Issue
Block a user