+2021-05-14 Bruno Haible <bruno@clisp.org>
+
+ fcntl tests: Avoid failure in MacPorts.
+ Reported by Nicholas Gaya <nicholasgaya@gmail.com> in
+ <https://lists.gnu.org/archive/html/bug-gnulib/2021-05/msg00014.html>.
+ * tests/test-fcntl.c (main): Close fd 10 before assuming that it is
+ closed.
+ * tests/test-execute-main.c: Update comment.
+
2021-05-14 Bruno Haible <bruno@clisp.org>
linked-list-unportable-test: New module.
Such file descriptors have been seen:
- with GNU make, when invoked as 'make -j N' with j > 1,
- in some versions of the KDE desktop environment,
- - on NetBSD.
+ - on NetBSD,
+ - in MacPorts with the "trace mode" enabled.
*/
#if HAVE_CLOSE_RANGE
if (close_range (3, 20 - 1, 0) < 0)
ASSERT (close (fd) == 0);
ASSERT (unlink (file) == 0);
+ /* Close file descriptors that may have been inherited from the parent
+ process and that would cause failures below.
+ Such file descriptors have been seen:
+ - with GNU make, when invoked as 'make -j N' with j > 1,
+ - in some versions of the KDE desktop environment,
+ - on NetBSD,
+ - in MacPorts with the "trace mode" enabled.
+ */
+ (void) close (10);
+
/* Test whether F_DUPFD_CLOEXEC is effective. */
ASSERT (fcntl (1, F_DUPFD_CLOEXEC, 10) >= 0);
#if defined _WIN32 && !defined __CYGWIN__