You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "Ben Webb (JIRA)" <ji...@apache.org> on 2014/03/26 22:16:18 UTC

[jira] [Updated] (AVRO-1488) FileBufferCopyIn::seek does not work on Windows systems

     [ https://issues.apache.org/jira/browse/AVRO-1488?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ben Webb updated AVRO-1488:
---------------------------

    Attachment: win32-seek.patch

> 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
>              Labels: easyfix, patch
>         Attachments: win32-seek.patch
>
>
> 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)