From d1b0ef5b3c9dc7a1f54b482b68bbde1d0c0a8481 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Mon, 22 Jun 2026 11:43:39 +0200 Subject: [PATCH] fincore: move sys/syscall.h include where it's needed Move the sys/syscall.h include inside the #ifndef HAVE_CACHESTAT block, since it's only needed for the fallback SYS_cachestat definition. Also clean up indentation of nested #ifdefs. Signed-off-by: Karel Zak --- misc-utils/fincore.c | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/misc-utils/fincore.c b/misc-utils/fincore.c index 5603de59b..e0624cd28 100644 --- a/misc-utils/fincore.c +++ b/misc-utils/fincore.c @@ -20,9 +20,6 @@ #include #include -#ifdef HAVE_SYS_SYSCALL_H -#include -#endif #include #include #include @@ -52,13 +49,17 @@ #ifndef HAVE_CACHESTAT -#ifndef SYS_cachestat -#if defined (__alpha__) -#define SYS_cachestat 561 -#else -#define SYS_cachestat 451 -#endif -#endif +# ifdef HAVE_SYS_SYSCALL_H +# include +# endif + +# ifndef SYS_cachestat +# if defined (__alpha__) +# define SYS_cachestat 561 +# else +# define SYS_cachestat 451 +# endif +# endif struct cachestat_range { uint64_t off; @@ -80,8 +81,8 @@ static inline int cachestat(unsigned int fd, return syscall(SYS_cachestat, fd, cstat_range, cstat, flags); } -#define HAVE_CACHESTAT 1 -#endif // HAVE_CACHESTAT +# define HAVE_CACHESTAT 1 +#endif /* !HAVE_CACHESTAT */ struct colinfo { const char * const name; -- 2.47.3