From: Aditya Agarwal Date: Tue, 26 Jun 2007 02:57:04 +0000 (+0000) Subject: -- make sure TFileTransport always starts at EOF X-Git-Tag: 0.2.0~1329 X-Git-Url: https://source.supwisdom.com/gerrit/gitweb?a=commitdiff_plain;h=58500e976364aea0df156a08b6c0336f6da26cd1;p=common%2Fthrift.git -- make sure TFileTransport always starts at EOF Reviewed By: jwang Test Plan: search git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665143 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/lib/cpp/src/transport/TFileTransport.cpp b/lib/cpp/src/transport/TFileTransport.cpp index 7a1ca4f7..28a42615 100644 --- a/lib/cpp/src/transport/TFileTransport.cpp +++ b/lib/cpp/src/transport/TFileTransport.cpp @@ -751,8 +751,8 @@ void TFileTransport::openLogFile() { throw TTransportException(errorMsg); } - // opening the file in append mode causes offset_t to be at the end - offset_ = lseek(fd_, 0, SEEK_CUR); + // seek to the end of the file + offset_ = lseek(fd_, 0, SEEK_END); } void TFileTransport::getNextFlushTime(struct timespec* ts_next_flush) {