From 6b10da4adc7a4601990eb3faf09809a496cf25b1 Mon Sep 17 00:00:00 2001 From: Masatake YAMATO Date: Sat, 18 Jun 2022 00:28:38 +0900 Subject: [PATCH] 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 --- misc-utils/lsfd-decode-file-flags.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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 -- 2.47.3