-- make sure TFileTransport always starts at EOF
authorAditya Agarwal <aditya@apache.org>
Tue, 26 Jun 2007 02:57:04 +0000 (02:57 +0000)
committerAditya Agarwal <aditya@apache.org>
Tue, 26 Jun 2007 02:57:04 +0000 (02:57 +0000)
Reviewed By: jwang

Test Plan: search

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665143 13f79535-47bb-0310-9956-ffa450edef68

lib/cpp/src/transport/TFileTransport.cpp

index 7a1ca4f..28a4261 100644 (file)
@@ -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) {