Fix pread and pwrite on os2 Windows
The previous code was jumping ahead by the specified offset, instead of getting the current offset.
This commit is contained in:
1 parent
1cd5cbb0e4
commit
ef99373c31
1 file changed
+2
-2
@@ -354,7 +354,7 @@ _read_at :: proc(f: ^File_Impl, p: []byte, offset: i64) -> (n: i64, err: Error)
|
|||||||
buf = buf[:MAX_RW]
|
buf = buf[:MAX_RW]
|
||||||
|
|
||||||
}
|
}
|
||||||
curr_offset := _seek(f, offset, .Current) or_return
|
curr_offset := _seek(f, 0, .Current) or_return
|
||||||
defer _seek(f, curr_offset, .Start)
|
defer _seek(f, curr_offset, .Start)
|
||||||
|
|
||||||
o := win32.OVERLAPPED{
|
o := win32.OVERLAPPED{
|
||||||
@@ -423,7 +423,7 @@ _write_at :: proc(f: ^File_Impl, p: []byte, offset: i64) -> (n: i64, err: Error)
|
|||||||
buf = buf[:MAX_RW]
|
buf = buf[:MAX_RW]
|
||||||
|
|
||||||
}
|
}
|
||||||
curr_offset := _seek(f, offset, .Current) or_return
|
curr_offset := _seek(f, 0, .Current) or_return
|
||||||
defer _seek(f, curr_offset, .Start)
|
defer _seek(f, curr_offset, .Start)
|
||||||
|
|
||||||
o := win32.OVERLAPPED{
|
o := win32.OVERLAPPED{
|
||||||
|
|||||||
Reference in new issue
Block a user