]> Savannah Git Hosting - gnulib.git/commitdiff
unistd-h tests: Check that unistd.h defines O_CLOEXEC.
authorCollin Funk <collin.funk1@gmail.com>
Sun, 16 Feb 2025 20:29:36 +0000 (12:29 -0800)
committerCollin Funk <collin.funk1@gmail.com>
Sun, 16 Feb 2025 20:29:36 +0000 (12:29 -0800)
* tests/test-unistd-h.c: Prefer #error to emitting a syntax error. Check
that O_CLOEXEC is defined.

ChangeLog
tests/test-unistd-h.c

index de21277abe49d633eb47e9d73fa966c4bddbeb63..ba22c1571a2af3a73fd6621aec58b13e054f5cef 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2025-02-16  Collin Funk  <collin.funk1@gmail.com>
 
+       unistd-h tests: Check that unistd.h defines O_CLOEXEC.
+       * tests/test-unistd-h.c: Prefer #error to emitting a syntax error. Check
+       that O_CLOEXEC is defined.
+
        unistd-h: Make sure O_CLOEXEC is defined.
        * modules/unistd-h (Depends-on): Add fcntl-h.
        * lib/unistd.in.h: Include fcntl.h if inclusion of unistd.h does not
index d7173956dfbbe32b28ae03ed4e0aabaab8d70fa7..fa869695836dffce3eaa6bed2939a4e031dd8a0e 100644 (file)
@@ -30,7 +30,11 @@ int sk[] = { SEEK_CUR, SEEK_END, SEEK_SET };
 /* Check that the various *_FILENO macros are defined.  */
 #if ! (defined STDIN_FILENO                                     \
        && (STDIN_FILENO + STDOUT_FILENO + STDERR_FILENO == 3))
-missing or broken *_FILENO macros
+# error "missing or broken *_FILENO macros"
+#endif
+
+#ifndef O_CLOEXEC
+# error "O_CLOEXEC is not defined"
 #endif
 
 /* Check that the types are all defined.  */