You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@avro.apache.org by th...@apache.org on 2018/12/28 14:43:44 UTC
[avro] 01/01: Fix for a crucial bug in C++ file handling under MS
Windows
This is an automated email from the ASF dual-hosted git repository.
thiru pushed a commit to branch AVRO-1488
in repository https://gitbox.apache.org/repos/asf/avro.git
commit aadbaa652a2acda1422801454c09ef1c91cc9572
Author: Thiruvalluvan M G <th...@startsmartlabs.com>
AuthorDate: Fri Dec 28 20:13:13 2018 +0530
Fix for a crucial bug in C++ file handling under MS Windows
---
lang/c++/impl/FileStream.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lang/c++/impl/FileStream.cc b/lang/c++/impl/FileStream.cc
index 9208b1d..b123a72 100644
--- a/lang/c++/impl/FileStream.cc
+++ b/lang/c++/impl/FileStream.cc
@@ -62,7 +62,7 @@ struct FileBufferCopyIn : public BufferCopyIn {
}
void seek(ssize_t len) {
- if (::SetFilePointer(h_, len, NULL, FILE_CURRENT) != INVALID_SET_FILE_POINTER) {
+ if (::SetFilePointer(h_, len, NULL, FILE_CURRENT) == INVALID_SET_FILE_POINTER && ::GetLastError() != NO_ERROR) {
throw Exception(boost::format("Cannot skip file: %1%") % ::GetLastError());
}
}