From db8b6d46a8783e3bb1ab9f9d96e33f840ea1a40f Mon Sep 17 00:00:00 2001 From: Yunmi Ha Date: Mon, 30 Dec 2019 16:56:47 +0900 Subject: [PATCH] Include 'sys/sysmacros.h' for GCC-9 - Include 'sys/sysmacros.h' if present. (Needed for major/minor definitions.) - cherry picked from commit 1d15da1bfc2b3acf1278ff087ddc303d945dd023 Change-Id: Ia7ba6e242870dc25dcea27d234147a6c3f1731bf Signed-off-by: Yunmi Ha --- configure.ac | 2 +- lib/utils_devpath.c | 3 +++ lib/utils_loop.c | 3 +++ lib/utils_wipe.c | 3 +++ 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 05574d2..d82a248 100644 --- a/configure.ac +++ b/configure.ac @@ -37,7 +37,7 @@ PKG_PROG_PKG_CONFIG AC_HEADER_DIRENT AC_HEADER_STDC AC_CHECK_HEADERS(fcntl.h malloc.h inttypes.h sys/ioctl.h sys/mman.h \ - ctype.h unistd.h locale.h byteswap.h endian.h) + sys/sysmacros.h ctype.h unistd.h locale.h byteswap.h endian.h) AC_CHECK_HEADERS(uuid/uuid.h,,[AC_MSG_ERROR([You need the uuid library.])]) AC_CHECK_HEADER(libdevmapper.h,,[AC_MSG_ERROR([You need the device-mapper library.])]) diff --git a/lib/utils_devpath.c b/lib/utils_devpath.c index 963785a..897d83b 100644 --- a/lib/utils_devpath.c +++ b/lib/utils_devpath.c @@ -31,6 +31,9 @@ #include #include #include +#ifdef HAVE_SYS_SYSMACROS_H +#include /* for major, minor */ +#endif #include "internal.h" static char *__lookup_dev(char *path, dev_t dev, int dir_level, const int max_level) diff --git a/lib/utils_loop.c b/lib/utils_loop.c index d7b03a1..640d95b 100644 --- a/lib/utils_loop.c +++ b/lib/utils_loop.c @@ -29,6 +29,9 @@ #include #include #include +#ifdef HAVE_SYS_SYSMACROS_H +#include /* for major, minor */ +#endif #include "utils_loop.h" diff --git a/lib/utils_wipe.c b/lib/utils_wipe.c index 210c566..c70d632 100644 --- a/lib/utils_wipe.c +++ b/lib/utils_wipe.c @@ -30,6 +30,9 @@ #include #include #include +#ifdef HAVE_SYS_SYSMACROS_H +#include /* for major, minor */ +#endif #include "libcryptsetup.h" #include "internal.h" -- 2.7.4