Errno -> Error

This commit is contained in:
gingerBill
2024-08-04 11:46:42 +01:00
parent def2e2e271
commit 160048eaee
14 changed files with 215 additions and 215 deletions
+4 -4
View File
@@ -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"
}
+1 -1
View File
@@ -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:]