tools: include sys/sysmacros.h on Linux

Due to a bug in the glibc headers the macros makedev(), major() and
minor() where avaialble by including sys/types.h. This bug was
addressed in glibc-2.25 by introducing a warning when these macros are
used. Since Xen is build with -Werror this new warning cause a compile
error.

Use sys/sysmacros.h to define these three macros.

blktap2 is already Linux specific. The kernel header which was used to
get makedev() does not provided it anymore, and it was wrong to use a
kernel header anyway.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Wei Liu <wei.liu2@citrix.com>
This commit is contained in:
Olaf Hering authored and Wei Liu committed 2017-03-15 10:22:33 +00:00
1 parent 15e90cd01f
commit 796dea37fb
2 files changed
+2

No files matched your search

+1
View File
@@ -33,6 +33,7 @@
#include <string.h>
#include <getopt.h>
#include <libgen.h>
#include <sys/sysmacros.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/ioctl.h>
+1
View File
@@ -39,6 +39,7 @@
#define SYSFS_PCI_DEV "/sys/bus/pci/devices"
#define SYSFS_PCIBACK_DRIVER "/sys/bus/pci/drivers/pciback"
#define NETBACK_NIC_NAME "vif%u.%d"
#include <sys/sysmacros.h>
#include <pty.h>
#include <uuid/uuid.h>
#elif defined(__sun__)
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.