mirror of
https://github.com/odin-lang/Odin.git
synced 2026-04-21 22:05:20 +00:00
make sure an eof is also returned from the file streams on non-windows
This commit is contained in:
@@ -54,6 +54,7 @@ _file_stream_proc :: proc(stream_data: rawptr, mode: io.Stream_Mode, p: []byte,
|
||||
return io.query_utility({.Close, .Flush, .Read, .Read_At, .Write, .Write_At, .Seek, .Size, .Query})
|
||||
}
|
||||
}
|
||||
|
||||
if err == nil && os_err != 0 {
|
||||
when ODIN_OS == .Windows {
|
||||
if os_err == ERROR_HANDLE_EOF {
|
||||
@@ -62,5 +63,12 @@ _file_stream_proc :: proc(stream_data: rawptr, mode: io.Stream_Mode, p: []byte,
|
||||
}
|
||||
err = .Unknown
|
||||
}
|
||||
|
||||
when ODIN_OS != .Windows {
|
||||
if err == nil && os_err == 0 && n == 0 {
|
||||
err = .EOF
|
||||
}
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user