* lib/savewd.c: Don’t include fcntl-safer.
[GNULIB_FCNTL_SAFER]: Include fcntl--.h.
(savewd_save): Use open, not open_safer.
* modules/savewd (Depends-on): Remove fcntl-safer.
---
 ChangeLog      | 6 ++++++
 lib/savewd.c   | 7 +++++--
 modules/savewd | 1 -
 3 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 30c45659cd..1e62e9acbf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2024-11-06  Paul Eggert  <egg...@cs.ucla.edu>
 
+       savewd: don’t depend on fcntl-safer
+       * lib/savewd.c: Don’t include fcntl-safer.
+       [GNULIB_FCNTL_SAFER]: Include fcntl--.h.
+       (savewd_save): Use open, not open_safer.
+       * modules/savewd (Depends-on): Remove fcntl-safer.
+
        savedir: don’t depend on dirent-safer
        * lib/savedir.c: Include dirent.h, not dirent--.h.
        * modules/savedir (Depends-on): Depend on dirent, not dirent-safer.
diff --git a/lib/savewd.c b/lib/savewd.c
index 216f416f0e..dee8524abe 100644
--- a/lib/savewd.c
+++ b/lib/savewd.c
@@ -33,9 +33,12 @@
 
 #include "assure.h"
 #include "attribute.h"
-#include "fcntl-safer.h"
 #include "filename.h"
 
+#if GNULIB_FCNTL_SAFER
+# include "fcntl--.h"
+#endif
+
 #if defined _WIN32 && !defined __CYGWIN__
 # define fork() (assure (false), -1)
 #endif
@@ -51,7 +54,7 @@ savewd_save (struct savewd *wd)
     case INITIAL_STATE:
       /* Save the working directory, or prepare to fall back if possible.  */
       {
-        int fd = open_safer (".", O_SEARCH);
+        int fd = open (".", O_SEARCH);
         if (0 <= fd)
           {
             wd->state = FD_STATE;
diff --git a/modules/savewd b/modules/savewd
index a0ea64fe6e..225a4c1a42 100644
--- a/modules/savewd
+++ b/modules/savewd
@@ -13,7 +13,6 @@ chdir
 errno
 extern-inline
 fchdir
-fcntl-safer
 fcntl-h
 filename
 raise
-- 
2.43.0


Reply via email to