]> git.ipfire.org Git - thirdparty/dbus.git/commitdiff
sysdeps: Include <linux/close_range.h> if available
authorSimon McVittie <smcv@collabora.com>
Wed, 2 Mar 2022 13:08:46 +0000 (13:08 +0000)
committerSimon McVittie <smcv@collabora.com>
Thu, 21 Apr 2022 10:02:44 +0000 (11:02 +0100)
This lets us use CLOSE_RANGE_CLOEXEC whenever the kernel headers
support it, even if glibc doesn't include this header via unistd.h yet.

Signed-off-by: Simon McVittie <smcv@collabora.com>
cmake/ConfigureChecks.cmake
configure.ac
dbus/dbus-sysdeps-unix.c

index f2ca64c7102b7826860ecf26ac40a4fd63298515..735a4fe0f837563a78e7ed269eda5c0907ea2bce 100644 (file)
@@ -17,6 +17,7 @@ check_include_file(expat.h     HAVE_EXPAT_H)
 check_include_file(grp.h        HAVE_GRP_H)     # dbus-sysdeps-util-win.c
 check_include_file(inttypes.h     HAVE_INTTYPES_H)   # dbus-pipe.h
 check_include_file(io.h         HAVE_IO_H)      # internal
+check_include_file(linux/close_range.h HAVE_LINUX_CLOSE_RANGE_H)
 check_include_file(locale.h     HAVE_LOCALE_H)
 check_include_file(memory.h     HAVE_MEMORY_H)
 check_include_file(signal.h     HAVE_SIGNAL_H)
index afe21813fdcbca2824e16ae3474f5173b248fb8e..eed8a7875a08a7aa6af04d9f0bf659e63e5281f1 100644 (file)
@@ -420,6 +420,7 @@ byteswap.h
 crt_externs.h
 dirent.h
 errno.h
+linux/close_range.h
 locale.h
 signal.h
 stdint.h
index c3dd0b83e410869a5ac23a1af09bdb74cb29b058..ced32063dee8f91ade2959741cd95b2305f6c3fe 100644 (file)
@@ -63,6 +63,9 @@
 #ifdef HAVE_ERRNO_H
 #include <errno.h>
 #endif
+#ifdef HAVE_LINUX_CLOSE_RANGE_H
+#include <linux/close_range.h>
+#endif
 #ifdef HAVE_SYSLOG_H
 #include <syslog.h>
 #endif