bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 9/9] opendirat: don’t depend on openat-safer


From: Paul Eggert
Subject: [PATCH 9/9] opendirat: don’t depend on openat-safer
Date: Wed, 6 Nov 2024 13:49:50 -0800

* lib/opendirat.c: Include fcntl.h.
[!GNULIB_OPENAT_SAFER]: Don’t include fcntl--.h.
* modules/opendirat (Depends-on): Depend on openat, not openat-safer.
---
 ChangeLog         | 5 +++++
 lib/opendirat.c   | 6 +++++-
 modules/opendirat | 2 +-
 3 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 87454b1325..68a6ebd3a2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2024-11-06  Paul Eggert  <eggert@cs.ucla.edu>
 
+       opendirat: don’t depend on openat-safer
+       * lib/opendirat.c: Include fcntl.h.
+       [!GNULIB_OPENAT_SAFER]: Don’t include fcntl--.h.
+       * modules/opendirat (Depends-on): Depend on openat, not openat-safer.
+
        getusershell: don’t depend on fopen-safer
        * lib/getusershell.c: Include stdio.h.
        [!GNULIB_FOPEN_SAFER]: Don’t include stdio--.h.
diff --git a/lib/opendirat.c b/lib/opendirat.c
index d2b567f8e7..269daf2423 100644
--- a/lib/opendirat.c
+++ b/lib/opendirat.c
@@ -22,9 +22,13 @@
 #include <opendirat.h>
 
 #include <errno.h>
-#include <fcntl--.h>
+#include <fcntl.h>
 #include <unistd.h>
 
+#ifdef GNULIB_OPENAT_SAFER
+# include "fcntl--.h"
+#endif
+
 /* Relative to DIR_FD, open the directory DIR, passing EXTRA_FLAGS to
    the underlying openat call.  On success, store into *PNEW_FD the
    underlying file descriptor of the newly opened directory and return
diff --git a/modules/opendirat b/modules/opendirat
index 17542ff4fa..61500512ee 100644
--- a/modules/opendirat
+++ b/modules/opendirat
@@ -10,7 +10,7 @@ c99
 dirent
 fcntl-h
 fdopendir
-openat-safer
+openat
 
 configure.ac:
 
-- 
2.43.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]