mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 15:48:51 +00:00
Fix broken cases of Seek usage in _file_stream_proc
Handles `EINVAL`, among other fixes.
This commit is contained in:
@@ -47,6 +47,14 @@ _file_stream_proc :: proc(stream_data: rawptr, mode: io.Stream_Mode, p: []byte,
|
||||
}
|
||||
case .Seek:
|
||||
n, os_err = seek(fd, offset, int(whence))
|
||||
if os_err != nil {
|
||||
switch whence {
|
||||
case .Start, .Current, .End:
|
||||
return 0, .Invalid_Offset
|
||||
case:
|
||||
return 0, .Invalid_Whence
|
||||
}
|
||||
}
|
||||
case .Size:
|
||||
n, os_err = file_size(fd)
|
||||
case .Destroy:
|
||||
|
||||
Reference in New Issue
Block a user