summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Carey <jcarey@argv.me>2017-06-26 11:09:10 -0400
committerJason Carey <jcarey@argv.me>2017-06-26 13:12:23 -0400
commite245cac2b3c18015dee8caddd449532785d15c2b (patch)
tree352c46953869ff480329498764db3f5103259231
parent862af7cdac5b9b9740335fd476209cd455f84c91 (diff)
downloadmongo-e245cac2b3c18015dee8caddd449532785d15c2b.tar.gz
SERVER-29855 Pull major/minor from sys/sysmacros.h
Per newer versions of glibc: ---- error: In the GNU C Library, "major" is defined by <sys/sysmacros.h>. For historical compatibility, it is currently defined by <sys/types.h> as well, but we plan to remove this soon. To use "major", include <sys/sysmacros.h> directly. If you did not intend to use a system-defined macro "major", you should undefine it after including <sys/types.h>. [-Werror] string path = str::stream() << "/sys/dev/block/" << major(dev) << ':' << minor(dev) ---- Including <sys/sysmacros.h> appears to be the correct solution to quiet the warning
-rw-r--r--src/mongo/db/storage/mmap_v1/mmap_v1_engine.cpp4
1 files changed, 4 insertions, 0 deletions
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 5a784b25dc7..c43e148d3f4 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 <boost/filesystem/path.hpp>
#include <fstream>
+#ifdef __linux__
+#include <sys/sysmacros.h>
+#endif
+
#include "mongo/db/client.h"
#include "mongo/db/mongod_options.h"
#include "mongo/db/operation_context.h"