From: Karel Zak Date: Mon, 13 Feb 2023 13:28:08 +0000 (+0100) Subject: include: cleanup close_range fallback X-Git-Tag: v2.39-rc1~80 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f191801c142e9fcf9d735b6b014aa1a18050a08d;p=thirdparty%2Futil-linux.git include: cleanup close_range fallback * let's use && operator rather than if-if * define HAVE_CLOSE_RANGE only if callback is really avalable Signed-off-by: Karel Zak --- diff --git a/include/fileutils.h b/include/fileutils.h index c71daf826f..51fdcd5984 100644 --- a/include/fileutils.h +++ b/include/fileutils.h @@ -85,14 +85,12 @@ static inline struct dirent *xreaddir(DIR *dp) #ifdef HAVE_SYS_SYSCALL_H # include -# if defined(SYS_close_range) +# if !defined(HAVE_CLOSE_RANGE) && defined(SYS_close_range) # include -# ifndef HAVE_CLOSE_RANGE static inline int close_range(unsigned int first, unsigned int last, int flags) { return syscall(SYS_close_range, first, last, flags); } -# endif # define HAVE_CLOSE_RANGE 1 # endif /* SYS_close_range */