From: Masatake YAMATO Date: Fri, 17 Jun 2022 15:28:38 +0000 (+0900) Subject: lsfd: try including asm/fcntl.h first for decoding flags of fdinfo X-Git-Tag: v2.39-rc1~602^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6b10da4adc7a4601990eb3faf09809a496cf25b1;p=thirdparty%2Futil-linux.git lsfd: try including asm/fcntl.h first for decoding flags of fdinfo Close #1720 The original code tried including asm-generic/fcntl.h before trying including asm/fcntl.h. This caused a bug in decoding flag of fdinfo on Linux running on armv7l. Signed-off-by: Masatake YAMATO --- diff --git a/misc-utils/lsfd-decode-file-flags.c b/misc-utils/lsfd-decode-file-flags.c index b958797549..6c31f75ddc 100644 --- a/misc-utils/lsfd-decode-file-flags.c +++ b/misc-utils/lsfd-decode-file-flags.c @@ -28,23 +28,23 @@ * A system on which lsfd is built may have multiple * fctl.h files: * - * - /usr/include/asm-generic/fcntl.h (a part of Linux kernel) * - /usr/include/asm/fcntl.h (a part of Linux kernel) + * - /usr/include/asm-generic/fcntl.h (a part of Linux kernel) * - /usr/include/fcntl.h (a part of glibc) * - /usr/include/bits/fcntl.h (a part of glibc) * - * For decoding purpose, /usr/include/asm-generic/fcntl.h or - * /usr/include/asm/fcntl.h is needed. + * For decoding purpose, /usr/include/asm/fcntl.h or + * /usr/include/asm-generic/fcntl.h is needed. * * /usr/include/bits/fcntl.h and /usr/include/fcntl.h are * not suitable for decoding. They should not be included. * /usr/include/fcntl.h includes /usr/include/bits/fcntl.h. */ -#ifdef HAVE_ASM_GENERIC_FCNTL_H -#include -#elif HAVE_ASM_FCNTL_H +#if defined HAVE_ASM_FCNTL_H #include +#elif defined HAVE_ASM_GENERIC_FCNTL_H +#include #else #error "kernel's fcntl.h is not available" #endif