mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 15:48:51 +00:00
Clean up error handling
This commit is contained in:
@@ -419,7 +419,7 @@ close :: proc(fd: Handle) -> Errno {
|
||||
if result == -1 {
|
||||
return Errno(get_last_error())
|
||||
}
|
||||
return ERROR_NONE
|
||||
return nil
|
||||
}
|
||||
|
||||
// If you read or write more than `SSIZE_MAX` bytes, OpenBSD returns `EINVAL`.
|
||||
@@ -476,7 +476,7 @@ rename :: proc(old_path, new_path: string) -> Errno {
|
||||
if res == -1 {
|
||||
return Errno(get_last_error())
|
||||
}
|
||||
return ERROR_NONE
|
||||
return nil
|
||||
}
|
||||
|
||||
remove :: proc(path: string) -> Errno {
|
||||
@@ -486,7 +486,7 @@ remove :: proc(path: string) -> Errno {
|
||||
if res == -1 {
|
||||
return Errno(get_last_error())
|
||||
}
|
||||
return ERROR_NONE
|
||||
return nil
|
||||
}
|
||||
|
||||
make_directory :: proc(path: string, mode: mode_t = 0o775) -> Errno {
|
||||
@@ -496,7 +496,7 @@ make_directory :: proc(path: string, mode: mode_t = 0o775) -> Errno {
|
||||
if res == -1 {
|
||||
return Errno(get_last_error())
|
||||
}
|
||||
return ERROR_NONE
|
||||
return nil
|
||||
}
|
||||
|
||||
remove_directory :: proc(path: string) -> Errno {
|
||||
@@ -506,7 +506,7 @@ remove_directory :: proc(path: string) -> Errno {
|
||||
if res == -1 {
|
||||
return Errno(get_last_error())
|
||||
}
|
||||
return ERROR_NONE
|
||||
return nil
|
||||
}
|
||||
|
||||
is_file_handle :: proc(fd: Handle) -> bool {
|
||||
@@ -638,7 +638,7 @@ _closedir :: proc(dirp: Dir) -> Errno {
|
||||
if rc != 0 {
|
||||
return Errno(get_last_error())
|
||||
}
|
||||
return ERROR_NONE
|
||||
return nil
|
||||
}
|
||||
|
||||
@private
|
||||
@@ -760,7 +760,7 @@ set_current_directory :: proc(path: string) -> (err: Errno) {
|
||||
if res == -1 {
|
||||
return Errno(get_last_error())
|
||||
}
|
||||
return ERROR_NONE
|
||||
return nil
|
||||
}
|
||||
|
||||
exit :: proc "contextless" (code: int) -> ! {
|
||||
|
||||
Reference in New Issue
Block a user