openSUSE / hwinfo

Hardware information tool
GNU General Public License v2.0
259 stars 70 forks source link

glibc 2.36+ includes fsconfig itself, make linux/fs.h inclusion conditional (bsc#1202213) #117

Closed wfeldt closed 2 years ago

wfeldt commented 2 years ago

Task

Compiling with glibc 2.36 fails with:

/usr/include/linux/mount.h:95:6: error: redeclaration of 'enum fsconfig_command'
   95 | enum fsconfig_command {
      |      ^~~~~~~~~~~~~~~~
In file included from hd.c:18:
/usr/include/sys/mount.h:189:6: note: originally defined here
  189 | enum fsconfig_command
      |      ^~~~~~~~~~~~~~~~

glibc 2.36 changelog says:

  * On Linux, the fsopen, fsmount, move_mount, fsconfig, fspick, open_tree,
    and mount_setattr have been added

Solution

Make linux/fs.h inclusion conditional.