]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
include: cleanup close_range fallback
authorKarel Zak <kzak@redhat.com>
Mon, 13 Feb 2023 13:28:08 +0000 (14:28 +0100)
committerKarel Zak <kzak@redhat.com>
Mon, 13 Feb 2023 13:28:08 +0000 (14:28 +0100)
* let's use && operator rather than if-if
* define HAVE_CLOSE_RANGE only if callback is really avalable

Signed-off-by: Karel Zak <kzak@redhat.com>
include/fileutils.h

index c71daf826f185c24b0e375f5518261f21ba6037b..51fdcd5984faebcb7043c3d6e2edcb3b3b3117f2 100644 (file)
@@ -85,14 +85,12 @@ static inline struct dirent *xreaddir(DIR *dp)
 #ifdef HAVE_SYS_SYSCALL_H
 # include <sys/syscall.h>
 
-# if defined(SYS_close_range)
+# if !defined(HAVE_CLOSE_RANGE) && defined(SYS_close_range)
 #  include <sys/types.h>
-#  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 */