From: Thomas De Schampheleire Date: Tue, 25 Oct 2016 17:22:39 +0000 (-0400) Subject: libsupport: fix compilation on RHEL 5.x due to missing magic define X-Git-Tag: 1.43.4~34 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b003b2e6f9e54e7b2bde15828b97f5dc285b915e;p=thirdparty%2Fe2fsprogs.git libsupport: fix compilation on RHEL 5.x due to missing magic define RHEL 5.x does have magic.h, but it does not define all expected symbols. In particular, the NO_CHECK symbols were only added in file 4.20 and RHEL 5.x is using 4.17. Add substitute defines to allow continued usage of magic but without the requested exclude checks. Signed-off-by: Thomas De Schampheleire Signed-off-by: Theodore Ts'o --- diff --git a/lib/support/plausible.c b/lib/support/plausible.c index 6f0c4bcb8..0636061c5 100644 --- a/lib/support/plausible.c +++ b/lib/support/plausible.c @@ -43,6 +43,17 @@ static const char *(*dl_magic_file)(magic_t, const char *); static int (*dl_magic_load)(magic_t, const char *); static void (*dl_magic_close)(magic_t); +/* + * NO_CHECK functionality was only added in file 4.20. + * Older systems like RHEL 5.x still have file 4.17 + */ +#ifndef MAGIC_NO_CHECK_COMPRESS +#define MAGIC_NO_CHECK_COMPRESS 0x0001000 +#endif +#ifndef MAGIC_NO_CHECK_ELF +#define MAGIC_NO_CHECK_ELF 0x0010000 +#endif + #ifdef HAVE_DLOPEN #include