Skip to content

Commit

Permalink
SERVER-29855 Pull major/minor from sys/sysmacros.h
Browse files Browse the repository at this point in the history
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
  • Loading branch information
hanumantmk committed Jun 26, 2017
1 parent 862af7c commit e245cac
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/mongo/db/storage/mmap_v1/mmap_v1_engine.cpp
Expand Up @@ -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"
Expand Down

0 comments on commit e245cac

Please sign in to comment.