Fixed non-linux build involving glog drop_log_meory flag.
The variable "FLAGS_drop_log_memory" is available only on Linux.
Review: https://reviews.apache.org/r/42704
diff --git a/src/logging/logging.cpp b/src/logging/logging.cpp
index 4639157..d651e15 100644
--- a/src/logging/logging.cpp
+++ b/src/logging/logging.cpp
@@ -37,12 +37,14 @@
#include "logging/logging.hpp"
+#ifdef __linux__
// Declare FLAGS_drop_log_memory flag for glog. This declaration is based on the
// the DECLARE_XXX macros from glog/logging.h.
namespace fLB {
extern GOOGLE_GLOG_DLL_DECL bool FLAGS_drop_log_memory;
}
using fLB::FLAGS_drop_log_memory;
+#endif
using process::Once;
@@ -171,6 +173,7 @@
FLAGS_logbufsecs = flags.logbufsecs;
+#ifdef __linux__
// Do not drop in-memory buffers of log contents. When set to true, this flag
// can significantly slow down the master. The slow down is attributed to
// several hundred `posix_fadvise(..., POSIX_FADV_DONTNEED)` calls per second
@@ -180,6 +183,7 @@
if (os::getenv("GLOG_drop_log_memory").isNone()) {
FLAGS_drop_log_memory = false;
}
+#endif
google::InitGoogleLogging(argv0.c_str());
if (flags.log_dir.isSome()) {