They aren’t needed in packages that use xstdopen
* lib/save-cwd.c: Do not include unistd--.h.
(GNULIB_FCNTL_SAFER): Do not define.
(save_cwd): Do not use fd_safer_flag, as the package should use
either fcntl-safer+unistd-safer or xstdopen if it cares about
closed stdin.
* modules/save-cwd (Depends-on): Remove fd-safer-flag, unistd-safer.
2024-11-06 Paul Eggert <eggert@cs.ucla.edu>
+ save-cwd: don’t depend on fd-safer-flag, unistd-safer
+ They aren’t needed in packages that use xstdopen
+ * lib/save-cwd.c: Do not include unistd--.h.
+ (GNULIB_FCNTL_SAFER): Do not define.
+ (save_cwd): Do not use fd_safer_flag, as the package should use
+ either fcntl-safer+unistd-safer or xstdopen if it cares about
+ closed stdin.
+ * modules/save-cwd (Depends-on): Remove fd-safer-flag, unistd-safer.
+
error: tune a bit for xstdopen
* lib/error.c (flush_stdout): Also optimize if GNULIB_XSTDOPEN.
#include <stdlib.h>
#include "chdir-long.h"
-#include "unistd--.h"
#if GNULIB_FCNTL_SAFER
# include "fcntl--.h"
-#else
-# define GNULIB_FCNTL_SAFER 0
#endif
/* Record the location of the current working directory in CWD so that
cwd->name = NULL;
cwd->desc = open (".", O_SEARCH | O_CLOEXEC);
- if (!GNULIB_FCNTL_SAFER)
- cwd->desc = fd_safer_flag (cwd->desc, O_CLOEXEC);
if (cwd->desc < 0)
{
cwd->name = getcwd (NULL, 0);
Depends-on:
chdir-long
fchdir
-fd-safer-flag
getcwd-lgpl
open
stdbool
-unistd-safer
configure.ac:
gl_SAVE_CWD