mirror of
https://github.com/valitydev/thrift.git
synced 2024-11-07 10:48:51 +00:00
-- fix overflow error in seekToChunk()
Summary: - I love finding overflow errors. Reviewed By: jwang Test Plan: tested by rolling back search logfile Notes: - This should not affect anything currently in production. git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665020 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
1ecb1b053a
commit
49aea10d7a
@ -630,7 +630,8 @@ void TFileTransport::seekToChunk(int32_t chunk) {
|
||||
minEndOffset = lseek(fd_, 0, SEEK_END);
|
||||
}
|
||||
|
||||
offset_ = lseek(fd_, chunk * chunkSize_, SEEK_SET);
|
||||
off_t newOffset = off_t(chunk) * chunkSize_;
|
||||
offset_ = lseek(fd_, newOffset, SEEK_SET);
|
||||
readState_.resetAllValues();
|
||||
if (offset_ == -1) {
|
||||
perror("TFileTransport: lseek error in seekToChunk");
|
||||
|
Loading…
Reference in New Issue
Block a user