From e245cac2b3c18015dee8caddd449532785d15c2b Mon Sep 17 00:00:00 2001 From: Jason Carey Date: Mon, 26 Jun 2017 11:09:10 -0400 Subject: [PATCH] SERVER-29855 Pull major/minor from sys/sysmacros.h Per newer versions of glibc: ---- error: In the GNU C Library, "major" is defined by . For historical compatibility, it is currently defined by as well, but we plan to remove this soon. To use "major", include directly. If you did not intend to use a system-defined macro "major", you should undefine it after including . [-Werror] string path = str::stream() << "/sys/dev/block/" << major(dev) << ':' << minor(dev) ---- Including appears to be the correct solution to quiet the warning --- src/mongo/db/storage/mmap_v1/mmap_v1_engine.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/mongo/db/storage/mmap_v1/mmap_v1_engine.cpp b/src/mongo/db/storage/mmap_v1/mmap_v1_engine.cpp index 5a784b25dc74e..c43e148d3f491 100644 --- a/src/mongo/db/storage/mmap_v1/mmap_v1_engine.cpp +++ b/src/mongo/db/storage/mmap_v1/mmap_v1_engine.cpp @@ -36,6 +36,10 @@ #include #include +#ifdef __linux__ +#include +#endif + #include "mongo/db/client.h" #include "mongo/db/mongod_options.h" #include "mongo/db/operation_context.h"