diff --git a/core/os_linux.odin b/core/os_linux.odin index 90250a625..99eea1a47 100644 --- a/core/os_linux.odin +++ b/core/os_linux.odin @@ -179,11 +179,11 @@ seek :: proc(fd: Handle, offset: i64, whence: int) -> (i64, Errno) { return res, 0; } -file_size :: proc(fd: Handle) -> (i64, bool) { +file_size :: proc(fd: Handle) -> (i64, Errno) { prev, _ := seek(fd, 0, SEEK_CUR); size, err := seek(fd, 0, SEEK_END); seek(fd, prev, SEEK_SET); - return size, err != 0; + return size, err; } diff --git a/core/os_x.odin b/core/os_x.odin index ecbed3f27..fcc39c218 100644 --- a/core/os_x.odin +++ b/core/os_x.odin @@ -196,11 +196,11 @@ seek :: proc(fd: Handle, offset: AddressSize, whence: int) -> (AddressSize, Errn return final_offset, 0; } -file_size :: proc(fd: Handle) -> (i64, bool) { +file_size :: proc(fd: Handle) -> (i64, Errno) { prev, _ := seek(fd, 0, SEEK_CUR); size, err := seek(fd, 0, SEEK_END); seek(fd, prev, SEEK_SET); - return size, err != 0; + return size, err; }