Try to map to General_Error where possible

This commit is contained in:
gingerBill
2024-08-04 11:44:45 +01:00
parent 28666414bc
commit def2e2e271
8 changed files with 103 additions and 7 deletions
+2 -3
View File
@@ -11,7 +11,7 @@ is_path_separator :: proc(c: byte) -> bool {
open :: proc(path: string, mode: int = O_RDONLY, perm: int = 0) -> (Handle, Errno) {
if len(path) == 0 {
return INVALID_HANDLE, ERROR_FILE_NOT_FOUND
return INVALID_HANDLE, General_Error.Not_Exist
}
access: u32
@@ -55,8 +55,7 @@ open :: proc(path: string, mode: int = O_RDONLY, perm: int = 0) -> (Handle, Errn
return handle, nil
}
err := get_last_error()
return INVALID_HANDLE, err
return INVALID_HANDLE, get_last_error()
}
close :: proc(fd: Handle) -> Errno {