From a29fc171a6aee45ab7f70e478f8d70e8045e9491 Mon Sep 17 00:00:00 2001 From: Haobo Xu Date: Mon, 15 Apr 2013 17:30:43 -0700 Subject: [PATCH] [RocksDB] posix_logger does not compile on non-linux platform Summary: As title. Found out this when testing stack_trace.cc portability. Test Plan: make check; manual test 'non-linux' build by forcing OS_LINUX2 Reviewers: dhruba, heyongqiang Reviewed By: dhruba CC: leveldb Differential Revision: https://reviews.facebook.net/D10263 --- util/posix_logger.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/posix_logger.h b/util/posix_logger.h index ac6615e97..8f4eef3f2 100644 --- a/util/posix_logger.h +++ b/util/posix_logger.h @@ -94,12 +94,12 @@ class PosixLogger : public Logger { } assert(p <= limit); + const size_t write_size = p - base; #ifdef OS_LINUX // If this write would cross a boundary of kDebugLogChunkSize // space, pre-allocate more space to avoid overly large // allocations from filesystem allocsize options. - const size_t write_size = p - base; const int last_allocation_chunk = ((kDebugLogChunkSize - 1 + log_size_) / kDebugLogChunkSize); const int desired_allocation_chunk =