Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-29855

Pull major/minor from sys/sysmacros.h on linux

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Minor - P4 Minor - P4
    • 3.5.10
    • Affects Version/s: None
    • Component/s: Internal Code
    • None
    • Fully Compatible
    • ALL
    • v3.4, v3.2
    • Platforms 2017-07-10

      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

            Assignee:
            mira.carey@mongodb.com Mira Carey
            Reporter:
            mira.carey@mongodb.com Mira Carey
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: