From 51d8e4c35ca1da255b4ebea9850ec2a84365e0a3 Mon Sep 17 00:00:00 2001
From: Cyrill Gorcunov <gorcunov@gmail.com>
Date: Wed, 28 Aug 2019 21:13:22 +0300
Subject: [PATCH] box/memtx: strip_core -- Warn on linux only

We know that madvise(MADV_DONTDUMP) is present
on linux based platforms only (macos doesn't
support it at all, freebsd requires MADV_NOCORE
or similar which is unsupported by now) thus
we should not print a warning on other systems
to not spam users.

Fixes #4464
---
 src/main.cc | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/src/main.cc b/src/main.cc
index 5776aa41db..b16cfa5fe3 100644
--- a/src/main.cc
+++ b/src/main.cc
@@ -496,7 +496,19 @@ load_cfg()
 	 */
 	if (cfg_geti("strip_core")) {
 		if (!small_test_feature(SMALL_FEATURE_DONTDUMP)) {
-			say_warn("'strip_core' is set but unsupported");
+			static const char strip_msg[] =
+				"'strip_core' is set but unsupported";
+#ifdef TARGET_OS_LINUX
+			/*
+			 * Linux is known to support madvise(DONT_DUMP)
+			 * feature, thus warn on this platform only. The
+			 * rest should be notified on verbose level only
+			 * to not spam a user.
+			 */
+			say_warn(strip_msg);
+#else
+			say_verbose(strip_msg);
+#endif
 		}
 	}
 
-- 
GitLab