Ben Webb created AVRO-1488:
------------------------------
Summary: FileBufferCopyIn::seek does not work on Windows systems
Key: AVRO-1488
URL: https://issues.apache.org/jira/browse/AVRO-1488
Project: Avro
Issue Type: Bug
Components: c++
Affects Versions: 1.7.6
Environment: Win32
Reporter: Ben Webb
FileBufferCopyIn::seek() on a Windows system generally fails with an exception.
This is because it is implemented as
if (::SetFilePointer(...) != INVALID_SET_FILE_POINTER) throw(...)
This test is the opposite of what it should be! SetFilePointer returns the new
pointer on success (sort of), just like lseek. See
http://msdn.microsoft.com/en-us/library/windows/desktop/aa365541%28v=vs.85%29.aspx
The fix is pretty simple - reverse the test. But apparently
INVALID_SET_FILE_POINTER is also a valid file pointer (that's not confusing at
all - thanks Microsoft!) so you also need to check the Windows error indicator
to make absolutely sure. I'll attach a patch.
--
This message was sent by Atlassian JIRA
(v6.2#6252)