0007-tools-include-sys-sysmacros.h-on-Linux.patch 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. From 796dea37fb229c34740f98bf80f3263d7a4e3c6d Mon Sep 17 00:00:00 2001
  2. From: Olaf Hering <olaf@aepfle.de>
  3. Date: Wed, 15 Mar 2017 07:01:34 +0000
  4. Subject: [PATCH] tools: include sys/sysmacros.h on Linux
  5. Due to a bug in the glibc headers the macros makedev(), major() and
  6. minor() where available by including sys/types.h. This bug was
  7. addressed in glibc-2.25 by introducing a warning when these macros are
  8. used. Since Xen is build with -Werror this new warning cause a compile
  9. error.
  10. Use sys/sysmacros.h to define these three macros.
  11. blktap2 is already Linux specific. The kernel header which was used to
  12. get makedev() does not provided it anymore, and it was wrong to use a
  13. kernel header anyway.
  14. Signed-off-by: Olaf Hering <olaf@aepfle.de>
  15. Acked-by: Wei Liu <wei.liu2@citrix.com>
  16. Signed-off-by: Alistair Francis <alistair.francis@xilinx.com>
  17. ---
  18. tools/blktap2/control/tap-ctl-allocate.c | 1 +
  19. tools/libxl/libxl_osdeps.h | 1 +
  20. 2 files changed, 2 insertions(+)
  21. diff --git a/tools/blktap2/control/tap-ctl-allocate.c b/tools/blktap2/control/tap-ctl-allocate.c
  22. index 8a6471e987..187cadcde7 100644
  23. --- a/tools/blktap2/control/tap-ctl-allocate.c
  24. +++ b/tools/blktap2/control/tap-ctl-allocate.c
  25. @@ -33,6 +33,7 @@
  26. #include <string.h>
  27. #include <getopt.h>
  28. #include <libgen.h>
  29. +#include <sys/sysmacros.h>
  30. #include <sys/stat.h>
  31. #include <sys/types.h>
  32. #include <sys/ioctl.h>
  33. diff --git a/tools/libxl/libxl_osdeps.h b/tools/libxl/libxl_osdeps.h
  34. index a40d62066b..de1d24ecae 100644
  35. --- a/tools/libxl/libxl_osdeps.h
  36. +++ b/tools/libxl/libxl_osdeps.h
  37. @@ -39,6 +39,7 @@
  38. #define SYSFS_PCI_DEV "/sys/bus/pci/devices"
  39. #define SYSFS_PCIBACK_DRIVER "/sys/bus/pci/drivers/pciback"
  40. #define NETBACK_NIC_NAME "vif%u.%d"
  41. +#include <sys/sysmacros.h>
  42. #include <pty.h>
  43. #include <uuid/uuid.h>
  44. #elif defined(__sun__)
  45. --
  46. 2.11.0